<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://rawpedia.rawtherapee.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jdc</id>
	<title>RawPedia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://rawpedia.rawtherapee.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jdc"/>
	<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/Special:Contributions/Jdc"/>
	<updated>2026-04-27T09:41:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10856</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10856"/>
		<updated>2025-01-23T08:02:17Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
&lt;br /&gt;
======Since 5.12,  Sigmoid based has been replaced by a Darktable-like version of Sigmoid======&lt;br /&gt;
This new version is based on the Darktable (and ART) code, but differs in that it takes different account of Mean luminance, White-Ev and Black-Ev.&lt;br /&gt;
* First - it uses 3 sliders&lt;br /&gt;
** Contrast, which acts on the slope of the Sigmoid.&lt;br /&gt;
** Skew, which moves the Sigmoid between whites and blacks.&lt;br /&gt;
** Display White point (cd/m2) : Allows you to adapt the white point to the peak luminance of the display device. Its position in the processing pipeline is not optimal so use with caution.&lt;br /&gt;
&lt;br /&gt;
* Second - You'll also find it in CAM16 Image adjustments. &lt;br /&gt;
** In this case, the 3 RGB variables are no longer used, but Q - CIECAM brightness. The results are different&lt;br /&gt;
&lt;br /&gt;
For the sake of compatibility and to keep a historical record (feedback), versions 5.11 are still available.&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltips======&lt;br /&gt;
Blackpoint:&lt;br /&gt;
Sets the Black point for a linear stretch of the image.&lt;br /&gt;
* For negatives slider values, in GHS ‘normal’, shadows are raised linearly to avoid excessive noise build-up and facilitate GHS work.&lt;br /&gt;
* For positives slider values, the histogram is shifted to the left. For Raw images you can also use Raw-Tab &amp;gt; Raw Black Points – Dehaze,  which is more precise.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image.&lt;br /&gt;
&lt;br /&gt;
* You can adjust a linear black point offset either:&lt;br /&gt;
** to account for noise in the dark parts.&lt;br /&gt;
** adjust the histogram.&lt;br /&gt;
* It is recommended to act on this sliders before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment.&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are differents and there are possible interactions with the White point.&lt;br /&gt;
&lt;br /&gt;
White point:&lt;br /&gt;
Sets the White point for a linear stretch of the image. Any pixel with value greater than the White point input will be clipped and the data lost.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image, which will be brightened. Pixels with values greater than the Whitepoint will appear white and have a value of 1.0.&lt;br /&gt;
* Setting this parameter to a value greater than 1 will extend the dynamic range at the high end.&lt;br /&gt;
* The 'Highlight reconstruction' method has a very strong impact on the White-point value.&lt;br /&gt;
* It is recommended to act on this slider before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are reversed and there are possible interactions with the Black point.&lt;br /&gt;
&lt;br /&gt;
=====Recommandations=====&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
Default 0.015 to avoid the zero value.&lt;br /&gt;
* This is the key balance value of the GHS system.&lt;br /&gt;
* Sets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP&lt;br /&gt;
* While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.&lt;br /&gt;
* SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
This parameter controls how tightly focused the stretch is around the Symmetry point (SP) by changing the form of the transform itself:&lt;br /&gt;
* For concentrated stretches (such as initial stretches on linear images) a large 'b' factor should be employed to focus a stretch within a histogram peak while de-focusing the stretch away from the histogram peak.&lt;br /&gt;
* For adjustment of non-linear images, lower 'b' parameters should be employed to distribute contrast and brightness more evenly.&lt;br /&gt;
* Large positive values of 'b' can be thought of as a histogram widener, ie spreading the histogram wider about the focus point, SP.&lt;br /&gt;
* By contrast, lower values of 'b' tend to shift the histogram to a brighter (or dimmer) position without affecting its width too greatly.&lt;br /&gt;
* As a general rule, the level of 'b' employed will decrease as a stretch sequence nears completion, although larger 'b' values can still be employed for precise placement of additional contrast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10855</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10855"/>
		<updated>2025-01-23T07:21:05Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltips======&lt;br /&gt;
Blackpoint:&lt;br /&gt;
Sets the Black point for a linear stretch of the image.&lt;br /&gt;
* For negatives slider values, in GHS ‘normal’, shadows are raised linearly to avoid excessive noise build-up and facilitate GHS work.&lt;br /&gt;
* For positives slider values, the histogram is shifted to the left. For Raw images you can also use Raw-Tab &amp;gt; Raw Black Points – Dehaze,  which is more precise.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image.&lt;br /&gt;
&lt;br /&gt;
* You can adjust a linear black point offset either:&lt;br /&gt;
** to account for noise in the dark parts.&lt;br /&gt;
** adjust the histogram.&lt;br /&gt;
* It is recommended to act on this sliders before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment.&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are differents and there are possible interactions with the White point.&lt;br /&gt;
&lt;br /&gt;
White point:&lt;br /&gt;
Sets the White point for a linear stretch of the image. Any pixel with value greater than the White point input will be clipped and the data lost.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image, which will be brightened. Pixels with values greater than the Whitepoint will appear white and have a value of 1.0.&lt;br /&gt;
* Setting this parameter to a value greater than 1 will extend the dynamic range at the high end.&lt;br /&gt;
* The 'Highlight reconstruction' method has a very strong impact on the White-point value.&lt;br /&gt;
* It is recommended to act on this slider before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are reversed and there are possible interactions with the Black point.&lt;br /&gt;
&lt;br /&gt;
=====Recommandations=====&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
Default 0.015 to avoid the zero value.&lt;br /&gt;
* This is the key balance value of the GHS system.&lt;br /&gt;
* Sets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP&lt;br /&gt;
* While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.&lt;br /&gt;
* SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
This parameter controls how tightly focused the stretch is around the Symmetry point (SP) by changing the form of the transform itself:&lt;br /&gt;
* For concentrated stretches (such as initial stretches on linear images) a large 'b' factor should be employed to focus a stretch within a histogram peak while de-focusing the stretch away from the histogram peak.&lt;br /&gt;
* For adjustment of non-linear images, lower 'b' parameters should be employed to distribute contrast and brightness more evenly.&lt;br /&gt;
* Large positive values of 'b' can be thought of as a histogram widener, ie spreading the histogram wider about the focus point, SP.&lt;br /&gt;
* By contrast, lower values of 'b' tend to shift the histogram to a brighter (or dimmer) position without affecting its width too greatly.&lt;br /&gt;
* As a general rule, the level of 'b' employed will decrease as a stretch sequence nears completion, although larger 'b' values can still be employed for precise placement of additional contrast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10854</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10854"/>
		<updated>2025-01-23T07:19:55Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltips======&lt;br /&gt;
Blackpoint:&lt;br /&gt;
Sets the Black point for a linear stretch of the image.&lt;br /&gt;
* For negatives slider values, in GHS ‘normal’, shadows are raised linearly to avoid excessive noise build-up and facilitate GHS work.&lt;br /&gt;
* For positives slider values, the histogram is shifted to the left. For Raw images you can also use Raw-Tab &amp;gt; Raw Black Points – Dehaze,  which is more precise.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image.&lt;br /&gt;
&lt;br /&gt;
* You can adjust a linear black point offset either:&lt;br /&gt;
** to account for noise in the dark parts.&lt;br /&gt;
** adjust the histogram.&lt;br /&gt;
* It is recommended to act on this sliders before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment.&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are differents and there are possible interactions with the White point.&lt;br /&gt;
&lt;br /&gt;
White point:&lt;br /&gt;
Sets the White point for a linear stretch of the image. Any pixel with value greater than the White point input will be clipped and the data lost.&lt;br /&gt;
* Contrast gained by performing the linear stretch will be evenly distributed over the image, which will be brightened. Pixels with values greater than the Whitepoint will appear white and have a value of 1.0.&lt;br /&gt;
* Setting this parameter to a value greater than 1 will extend the dynamic range at the high end.&lt;br /&gt;
* The 'Highlight reconstruction' method has a very strong impact on the White-point value.&lt;br /&gt;
* It is recommended to act on this slider before implementing the GHS algorithm to avoid clipping data. A very low Stretch factor (D) value (0.001 by default) is recommended for performing this adjustment&lt;br /&gt;
* The label 'Clipped pixel count Shadows:x Highlights=y' shows you the number of pixels that would be clipped without action on the 2 sliders.&lt;br /&gt;
* The label Pixel values -Darkest:w Lightest:z shows you the values of real limits in range [0 1].&lt;br /&gt;
* In ‘Inverse GHS’ mode the trends are reversed and there are possible interactions with the Black point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
Default 0.015 to avoid the zero value.&lt;br /&gt;
* This is the key balance value of the GHS system.&lt;br /&gt;
* Sets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP&lt;br /&gt;
* While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.&lt;br /&gt;
* SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
This parameter controls how tightly focused the stretch is around the Symmetry point (SP) by changing the form of the transform itself:&lt;br /&gt;
* For concentrated stretches (such as initial stretches on linear images) a large 'b' factor should be employed to focus a stretch within a histogram peak while de-focusing the stretch away from the histogram peak.&lt;br /&gt;
* For adjustment of non-linear images, lower 'b' parameters should be employed to distribute contrast and brightness more evenly.&lt;br /&gt;
* Large positive values of 'b' can be thought of as a histogram widener, ie spreading the histogram wider about the focus point, SP.&lt;br /&gt;
* By contrast, lower values of 'b' tend to shift the histogram to a brighter (or dimmer) position without affecting its width too greatly.&lt;br /&gt;
* As a general rule, the level of 'b' employed will decrease as a stretch sequence nears completion, although larger 'b' values can still be employed for precise placement of additional contrast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10853</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10853"/>
		<updated>2025-01-23T07:13:44Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Incidence of Local intensity (b) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
Default 0.015 to avoid the zero value.&lt;br /&gt;
* This is the key balance value of the GHS system.&lt;br /&gt;
* Sets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP&lt;br /&gt;
* While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.&lt;br /&gt;
* SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
This parameter controls how tightly focused the stretch is around the Symmetry point (SP) by changing the form of the transform itself:&lt;br /&gt;
* For concentrated stretches (such as initial stretches on linear images) a large 'b' factor should be employed to focus a stretch within a histogram peak while de-focusing the stretch away from the histogram peak.&lt;br /&gt;
* For adjustment of non-linear images, lower 'b' parameters should be employed to distribute contrast and brightness more evenly.&lt;br /&gt;
* Large positive values of 'b' can be thought of as a histogram widener, ie spreading the histogram wider about the focus point, SP.&lt;br /&gt;
* By contrast, lower values of 'b' tend to shift the histogram to a brighter (or dimmer) position without affecting its width too greatly.&lt;br /&gt;
* As a general rule, the level of 'b' employed will decrease as a stretch sequence nears completion, although larger 'b' values can still be employed for precise placement of additional contrast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10852</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10852"/>
		<updated>2025-01-23T07:10:20Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The essential role of Symmetry point (SP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
======Associated Tooltip======&lt;br /&gt;
Default 0.015 to avoid the zero value.&lt;br /&gt;
* This is the key balance value of the GHS system.&lt;br /&gt;
* Sets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP&lt;br /&gt;
* While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.&lt;br /&gt;
* SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10851</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10851"/>
		<updated>2025-01-23T07:07:31Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Generalized Hyperbolic Stretch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Introduction====&lt;br /&gt;
GHS - Generalized Hyperbolic Strectch, brings a new way of processing images. The vocabulary used is different from what we're used to (contrast, brightness, etc.), so I'd like to take this opportunity to make a (personal) point about the different conceptions of software (free or paid).&lt;br /&gt;
&lt;br /&gt;
This document was originally produced in French, but I won't be putting the French version online, as it is said that in the near future, the English version will be the basis, with translations to follow.&lt;br /&gt;
As I'm not an English speaker, I used DeepL to create this version. I am open to possible amendments.&lt;br /&gt;
&lt;br /&gt;
In addition, a large part of the information is contained in the Tooltips. Their content is directly inspired by that of PixInsight (authors of the algorithm). When I deem it necessary to avoid redundancy, I will quote from the Tooltips.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
=====Masks and U-points / Rt-spot=====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
=====Several concepts=====&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
=====Photographers and engineers=====&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10850</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10850"/>
		<updated>2025-01-22T18:01:27Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Five ways to change the exposure and lift the shadows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Six ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure)&lt;br /&gt;
** Generalize Hyperbolic Strech (GHS) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Using Generalize Hyperbolic Stretch - GHS=====&lt;br /&gt;
[[Local_Adjustments#Generalized_Hyperbolic_Stretch| GHS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10849</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10849"/>
		<updated>2025-01-22T17:56:19Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22/01/2025&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10848</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10848"/>
		<updated>2025-01-22T17:54:57Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Mathematical principles used for transformations depending on the value of (b) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
Representation with Desmos [https://www.desmos.com/calculator/xufftbzks6]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10847</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10847"/>
		<updated>2025-01-22T17:00:18Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* First step: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First step]]&lt;br /&gt;
In this first step:&lt;br /&gt;
* the White point (WP linear) has a high value, mainly due to the use of Highlight reconstruction – Color propagation.&lt;br /&gt;
* the Black point (BP linear) is used in negative value, to slightly open up the shadows, reduce the need for a high Stretch factor (D) and slightly increase the value of Symmetry point (SP).&lt;br /&gt;
* Note the values ​​of Protect shadows (LP) at 0.0 and Protect Highlights (HP) at 1.0 and the non-use of Highlight attenuation&lt;br /&gt;
* The Graduated filter is activated with the Spot positioned in the middle of the sky, to reduce the brightness of the upper part of the image.&lt;br /&gt;
&lt;br /&gt;
=====Second step:=====&lt;br /&gt;
* Histogram in ‘output profile – gamma’ mode.&lt;br /&gt;
* To give more contrast and saturation to the image – is it necessary, but for educational purposes – I activated in the ‘Exposure’ module – Auto-Matched Tone Curve. I could have made other choices like using Selective Editing – Wavelet – Local Contrast.&lt;br /&gt;
* In order to have a better rendering of the sky, I activated Highlight Attenuation and set Protect Highlights (HP) to 0.9&lt;br /&gt;
[[File:Ghs-example2.jpg|600px|thumb|center| GHS Example Second step]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-example2.jpg&amp;diff=10846</id>
		<title>File:Ghs-example2.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-example2.jpg&amp;diff=10846"/>
		<updated>2025-01-22T16:59:31Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10845</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10845"/>
		<updated>2025-01-22T16:57:30Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* First step: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
[[File:Ghs-example1.jpg|600px|thumb|center| GHS Example First]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-example1.jpg&amp;diff=10844</id>
		<title>File:Ghs-example1.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-example1.jpg&amp;diff=10844"/>
		<updated>2025-01-22T16:56:09Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10843</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10843"/>
		<updated>2025-01-22T16:54:14Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* A simple example of using GHS= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10842</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10842"/>
		<updated>2025-01-22T16:53:56Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Stretch Regularization &amp;amp; Midtones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
====A simple example of using GHS=====&lt;br /&gt;
Raw image: IMGP2426.DNG&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17R3iBq08s71DuDRiv9T6TzlJVsxqBISo/view?usp=drive_link]&lt;br /&gt;
=====First step:=====&lt;br /&gt;
** Neutral – Histogram in ‘working profile – linear’ mode.&lt;br /&gt;
** Highlight reconstruction – Color Propagation&lt;br /&gt;
** White Balance Auto  - Temperature correlation&lt;br /&gt;
** Selective Editing : Global &lt;br /&gt;
** Shadows/Highlights, Equalizer &amp;amp; GHS&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10841</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10841"/>
		<updated>2025-01-22T16:50:53Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Mathematical principles used for transformations depending on the value of (b) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
=====One recommendation: use GHS in Neutral mode =====&lt;br /&gt;
It's important to control GHS under optimum conditions. This means eliminating any parameters that could disrupt the analysis. I recommend working in Neutral mode. You can (must) activate :&lt;br /&gt;
* Highlight reconstruction: which has a very strong impact on the calculation of the White point (WP linear).&lt;br /&gt;
* Denoise - if necessary,&lt;br /&gt;
* White Balance: prefer Auto - Temperature correlation,&lt;br /&gt;
* Capture Sharpening and Raw functions.&lt;br /&gt;
* Toggle histogram and data display to 'Working profile - linear' mode.&lt;br /&gt;
&lt;br /&gt;
In Selective Editing, activate GHS as the first tool, in the first Spot you create. &lt;br /&gt;
&lt;br /&gt;
Once GHS has been set up, you can activate additional contrast, luminance and saturation functions if required, paying particular attention to those upstream of GHS, such as Contrast By Detail Levels or Haze Removal, which will modify the data received by GHS - and retouch, if necessary, the black point (BP linear) and white point (WP linear).&lt;br /&gt;
* Toggle histogram and data to 'Output profile – gamma'.&lt;br /&gt;
&lt;br /&gt;
=====Various data processing modes - RGB, Lab, HSL=====&lt;br /&gt;
6 modes are available:&lt;br /&gt;
* RGB Luminance (default setting): the 3 RGB channels are modified by taking into account the average luminance obtained from the working profile's XYZ data. Recommended mode.&lt;br /&gt;
* RGB Standard: the 3 RGB channels are modified in the same way.&lt;br /&gt;
* Luminance &amp;amp; chromaticity (Lab): these 2 values, L (luminance) and C (chromaticity) after RGB &amp;gt; Lab transformation, have different peaks for L (luminance) and C (chromaticity), which seems obvious. I've chosen to let the user - with the help of the histogram - manage this difference by adjusting the Chromaticity Lab factor (C) slider, and/or the Slope Lab factor (S) slider in Advanced mode. These settings modify the GHS function in different ways for L and C, and modify the linear part of the Lab transform (which is in fact a TRC Tone Response Curve). Acting on GHS in Lab mode is no longer a linear mode, and will generally have the following consequences, compared to RGB mode:&lt;br /&gt;
** increase the Symmetry Point (SP).&lt;br /&gt;
** reduce the Stretch factor (D).&lt;br /&gt;
* Luminance (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the luminance channel is taken into account. It's likely that the Saturation (HSL) component will need to be modified with another Spot.&lt;br /&gt;
* Saturation (HSL): after RGB &amp;gt; HSL conversion - is a linear transformation. Only the saturation channel is taken into account. It is likely that the Luminance (HSL) component will then need to be adjusted with another Spot.&lt;br /&gt;
* Hue (HSL): after RGB &amp;gt; HSL conversion, is a linear transformation. Only the Hue channel is affected. The GHS transform will profoundly modify the image colors with Color Toning effects.&lt;br /&gt;
&lt;br /&gt;
I haven't chosen to propose a separate action on each R, G and B channel, but of course it's possible.&lt;br /&gt;
&lt;br /&gt;
=====Stretch Regularization &amp;amp; Midtones=====&lt;br /&gt;
It is normal when stretching or compressing an image that the local contrast and saturation are changed, it cannot be otherwise.&lt;br /&gt;
* the Value (LC) slider, allows to compensate the local contrast (the saturation part is &amp;quot;automatic&amp;quot; only in RGB Luminance mode). The way this compensation acts depends on the data processing mode, the most efficient is RGB Luminance. But the action on this slider does not replace a user's wish to increase the Local contrast, it will be up to him to act for example with the Selective Editing Wavelet tool - Local contrast and/or Clarity.&lt;br /&gt;
* the Midtones slider, allows to retouch the midtones, only if necessary, after running GHS to restore the average luminance values.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10840</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10840"/>
		<updated>2025-01-22T16:49:54Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Mathematical principles used for transformations depending on the value of (b) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
[[File:Ghs-visu.jpg|600px|thumb|center| GHS Curve Visualization]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-visu.jpg&amp;diff=10839</id>
		<title>File:Ghs-visu.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:Ghs-visu.jpg&amp;diff=10839"/>
		<updated>2025-01-22T16:48:26Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10838</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10838"/>
		<updated>2025-01-22T16:46:09Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The essential role of Symmetry point (SP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
=====Incidence of Local intensity (b) =====&lt;br /&gt;
High positive values of (b ) can be considered as histogram wideners, i.e. they lead to a wider spread of the histogram around the point of focus (SP). On the other hand, lower values of (b) tend to shift the histogram towards a brighter (or darker) rendering without affecting its width too significantly. As a general rule, the level of (b) used decreases as more stretching sequences are added, when using a second spot.&lt;br /&gt;
&lt;br /&gt;
======Mathematical principles used for transformations depending on the value of (b)======&lt;br /&gt;
* (b) = -1: logarithmic;&lt;br /&gt;
* (b) &amp;lt; 0: modified hyperbolic;&lt;br /&gt;
* (b) = 0: exponential;&lt;br /&gt;
* (b) &amp;gt; 0: hyperbolic.&lt;br /&gt;
Where conditions permit:&lt;br /&gt;
* (LP) less than (SP);&lt;br /&gt;
* (HP) greater than (SP).&lt;br /&gt;
and the user acts on the Protect shadows (LP) or Protect highlights (HP) sliders, the functions mentioned above for (b) are progressively transformed into linear functions. These two adaptations are a key factor in the control of lowlights and noise, and the progressiveness of highlights. &lt;br /&gt;
I've adapted the GUI so that the range of possible settings for (LP) and (HP) is a function of (SP).&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10837</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10837"/>
		<updated>2025-01-22T16:45:15Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
=====Particularities of Black Point (BP linear) and Highlight Attenuation checkbox=====&lt;br /&gt;
* If Black Point (BP linear) is used with negative values, where possible (Black Point indicators at zero), the black point will not be modified, but the luminance of very low lights will be increased. This action will facilitate the work of the GHS algorithm by raising the Symmetry point (SP).&lt;br /&gt;
* The Highlight Attenaution checkbox completes the processing of highlights - Protect Highlights (HP) - in cases of high Dynamic Range, the GHS setting may be insufficient.  This action on the checkbox will, on the one hand, attenuate highlights after GHS and, on the other, take into account the Protect Highlights (HP) setting to increase the effect of this attenuation.&lt;br /&gt;
&lt;br /&gt;
=====The essential role of Symmetry point (SP)=====&lt;br /&gt;
This is probably the key factor in understanding how GHS works. It is around this point that image transformations will take place.&lt;br /&gt;
As this algorithm is designed to process highly dynamic and often under-exposed images, I have chosen a default value of 0.015 (arbitrary). &lt;br /&gt;
The system works on linear data, in the Working profile (default: Prophoto) - the values to be taken into account are naturally offset from the image rendered in the Preview (which by default takes into account a gamma and the monitor profile). As with the (WP linear) and (BP linear) settings, it is therefore advisable to toggle the histogram and gamut button readouts to linear and working profile mode.&lt;br /&gt;
By observing the histogram in RGB mode, you can assess the position of the luminance peak(s). It's around this value(s) that you need to adjust (SP). The % position of the histogram peak on the 'x' axis gives a good approximation of the (SP) setting.&lt;br /&gt;
&lt;br /&gt;
If the image is very underexposed, or has two significant luminance peaks, it is advisable to proceed in 2 (or more) steps with smaller Stretch factor (D) values.&lt;br /&gt;
If the Black point setting (BP linear) allows (no use of positive values to re-establish contrast), you can slightly open up the shadows with negative Black point values, to enable better evaluation of the Symmetry point (SP). This action is performed before GHS.&lt;br /&gt;
It is illusory to believe that it is possible (as in astrophoto - unless you can show me otherwise) to automatically adjust (SP) from a value captured on the image or histogram. This is certainly relevant in astrophoto, for example using the luminance value of a nebula, but unrealistic here. The position of the peak(s) in the histogram seems to me sufficient, more relevant and sufficient.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10836</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10836"/>
		<updated>2025-01-22T16:44:18Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======Second image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
[[File:BP-WP-3.jpg|600px|thumb|center| Black point - White point 3]]&lt;br /&gt;
&lt;br /&gt;
* touch the White point (WP linear) until Clipped pixel count Highlight is 0 and Pixel values Lightest is 1.&lt;br /&gt;
* check that the values set (here 0) are correct by moving the Black point on the right-hand side of the slider (BP linear). If you move the slider a little to the right and the values for Clipped pixel count Shadows and Pixel value -Darkest are no longer zero, you should not change the Black point setting (BP linear).&lt;br /&gt;
&lt;br /&gt;
You will be able to see on the images that require a 'Highlight reconstruction', the effectiveness of the various methods proposed, by seeing the White point value (White point (WP linear).  For example :&lt;br /&gt;
* None : 1.1&lt;br /&gt;
* Inpaint Opposed : 2.1&lt;br /&gt;
* Color Propagation : 3.2&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-3.jpg&amp;diff=10835</id>
		<title>File:BP-WP-3.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-3.jpg&amp;diff=10835"/>
		<updated>2025-01-22T16:42:50Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10834</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10834"/>
		<updated>2025-01-22T16:40:20Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* First image in Neutral mode with Black point and White point retouching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
======2nd image image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: 5D3_0104.CR2&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tsmOPbyfnya-mLtHmKE6U0Dba0f2cOaC/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: the right-hand part is far from the right-hand vertical axis, and Pixel values Lightest is at 0.63, so the white point needs adjusting.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10833</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10833"/>
		<updated>2025-01-22T16:36:56Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* First image in Neutral mode with Black point and White point retouching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
[[File:BP-WP-2.jpg|600px|thumb|center| Black point - White point 2]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-2.jpg&amp;diff=10832</id>
		<title>File:BP-WP-2.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-2.jpg&amp;diff=10832"/>
		<updated>2025-01-22T16:36:06Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10831</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10831"/>
		<updated>2025-01-22T16:33:29Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
* Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1mSRiKwmnLoKGaGE4pa_vnA80gzPOobYX/view?usp=drive_link]&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode with Black point and White point retouching======&lt;br /&gt;
* retouch the Black point (BP linear), shift the slider to the right, until the histogram on the left is close to the vertical axis, and Clipped pixel count and Pixel value - Darkest are at 0. In the example, the value found is 0.1247&lt;br /&gt;
* retouch the White-point, until Clipped pixel count Highlight is 0, and Pixel values Lightest is 1. In the example, the value found is 1.0809&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10830</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10830"/>
		<updated>2025-01-22T16:29:45Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
======First image in Neutral mode, without Black Point (BP linear) and White Point (WP linear) retouching======&lt;br /&gt;
Raw image: D200_20070802_2087.NEF&lt;br /&gt;
&lt;br /&gt;
Look at the histogram: on the left, the values start far from the origin; the Black Point needs to be adjusted.&lt;br /&gt;
Look at the data Clipped pixel counts Highlights = 230 and Pixel values Darkest:0.12 and Lightest=1.08 confirm the need to adjust the Black point, but also the White point.&lt;br /&gt;
&lt;br /&gt;
[[File:BP-WP-1.jpg|600px|thumb|center| Black point - White point 1]]&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-1.jpg&amp;diff=10829</id>
		<title>File:BP-WP-1.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:BP-WP-1.jpg&amp;diff=10829"/>
		<updated>2025-01-22T16:25:45Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10828</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10828"/>
		<updated>2025-01-22T16:22:08Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil1.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:Gamu-profil1.jpg&amp;diff=10827</id>
		<title>File:Gamu-profil1.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:Gamu-profil1.jpg&amp;diff=10827"/>
		<updated>2025-01-22T16:21:03Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10826</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10826"/>
		<updated>2025-01-22T16:16:14Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The need to fine-tune White Point (WP linear) and Black Point (BP linear) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
[[File:Gamu-profil.jpg|600px|thumb|center| Gamut profile]]&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=File:Gamu-profil.jpg&amp;diff=10825</id>
		<title>File:Gamu-profil.jpg</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=File:Gamu-profil.jpg&amp;diff=10825"/>
		<updated>2025-01-22T16:13:30Z</updated>

		<summary type="html">&lt;p&gt;Jdc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10824</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10824"/>
		<updated>2025-01-22T16:04:10Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Background on the history of digital photography - GHS and Selective Editing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
====Generalized Hyperbolic Strech - GHS - origine====&lt;br /&gt;
I believe (to be verified) that two people came up with a new approach to the general problems seen above. The methods we know today are mostly derived from the work of the film industry by ACES or in the continuity of the work of the precursor Adobe (I can cite - non-exhaustive - functions such as: Log encoding, Sigmoid, Gamut compress, etc.). These two people, David Payne and Mike Cranfield, have come up with 'something else' with a vocabulary that is a little 'disturbing'. The system uses foreign concepts such as 'Symmetry Point', 'Stretch' and 'Local Intensity'. The internal functions are quite complex, working at pixel level. They are continuous functions that modify pixel intensity and, according to their authors, enable:&lt;br /&gt;
* initial stretching (and compression) of pixel values from a linear state.&lt;br /&gt;
* add contrast to key areas of the image.&lt;br /&gt;
* general brightening or darkening of the image.&lt;br /&gt;
* adjust the dynamic range of the image.&lt;br /&gt;
* I've added the possibility of using several modes (RGB, Lch, Saturation, Hue) to modify the image as desired: maintaining overall balance while preserving contrasts, etc., or acting as a Color-toning.&lt;br /&gt;
These algorithms and functions have found a home in astrophotography software (Siril, Pixlnsight). Examination of the tutorials and code for these two programs (Siril code only) shows that the initial scope is broader than astrophotography, and can be extended to general photography. The major difference - nevertheless foreseen by the authors - is the extension to highlights and high dynamic range, rarely found in astrophotography.&lt;br /&gt;
&lt;br /&gt;
====GHS - available settings====&lt;br /&gt;
=====Simplified operation - Principle =====&lt;br /&gt;
Five settings act directly on GHS:&lt;br /&gt;
* Stretch factor (D): controls the extent of the stretch.&lt;br /&gt;
* Local intensity (b) - linear factor: controls the degree to which the stretch is focused around the Symmetry point (SP), by modifying the shape of the transformation itself.&lt;br /&gt;
* Symmetry point (SP): defines the focal point around which the stretch is applied - the contrast will be distributed symmetrically with respect to (SP). While (b) determines the degree of focus of the stretch, (SP) determines where this focus is applied. (SP) should generally be placed close to a histogram peak(s) so that the stretch widens and lowers the peak(s), adding the most contrast to the stretch at this point.&lt;br /&gt;
* Protect shadows (LP): defines a value below which stretching is modified to preserve contrast in shadows and lowlights. To achieve this, a linear transformation of the data is performed below the (LP) level, reserving the contrast of the rest of the image. Among other things, this makes it possible to better control noise.&lt;br /&gt;
* Protect highlights (HP): defines a value above which stretching is modified to preserve contrast in the highlights. To do this, a linear transformation of the data is performed above the HP level, reserving the contrast of the rest of the image. This allows you to better control the progression of highlights.&lt;br /&gt;
&lt;br /&gt;
In simplified terms, by assimilation, the system functions as an 'S-curve' (or inverted S-curve) that modifies the image while preserving contrast, highlights and lowlights through the use of asymptotic functions.&lt;br /&gt;
The inflection point (where it exists) is defined by the symmetry point (SP), e.g. SP=0.5 will generate a symmetrical 'S-curve' for RGB values below the symmetry point (SP) or above.&lt;br /&gt;
The Stretch factor (D) will make this curve more or less pronounced, with very progressive asymptotes in the low and high light ranges.&lt;br /&gt;
The linear factor - Local intensity (b) - modifies the shape of the 'S', reducing or increasing the 'length' of the asymptotic parts.&lt;br /&gt;
&lt;br /&gt;
These three factors can be used to modify image contrast, by attempting to preserve local contrast overall, filling in valleys and reducing peaks.&lt;br /&gt;
&lt;br /&gt;
* The 'Inverse GHS' checkbox: enables you to use the inverse form of the transformation equations.  This allows you to substantially recover the original image, subject to the precision of the calculations, but above all to the values of the black and white points. For example, the 'Inverse GHS' mode will enable you to reduce the action created with a first RT-spot in 'Global' mode, aimed at brightening an image globally and adapting contrast. By adding an RT-spot in 'Inverse GHS' mode localized on a part of the image (sky,...), the overall contrast and color balance will be preserved. Of course, with Selective Editing, you can use an Excluding Spot, but it will often be less effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The need to fine-tune White Point (WP linear) and Black Point (BP linear)=====&lt;br /&gt;
The algorithm developed by David Payne and Mike Cranfield assumes that all image data to be processed is in the interval [0 ,1]. &lt;br /&gt;
* Negative values or values greater than 1 will be ignored (clipped).&lt;br /&gt;
* If shooting conditions or upstream processing reduce the practical interval to different values, e.g. [0.2, 0.9], the algorithm will only partially fill them. It is therefore advisable to find the values of the black and white points to obtain an interval of data before GHS processing in the range as close as possible to [0, 1].&lt;br /&gt;
* Move the White point (WP linear) slider slightly. Move this slider until you obtain a Clipped White point value close to 0. You will also see the values of data that may have been lost or misused.&lt;br /&gt;
* Move the Black point (BP linear) slider slightly to the right (positive values). Move this slider until you obtain a minimum Clipped Black point value. If no upstream processing has been performed, the first value to be retained will be Clipped Black point = -1.&lt;br /&gt;
&lt;br /&gt;
To make these settings easier, set the 'gamut' knob so that the data and histogram use the same values as those - linear + working profile - used by GHS. &lt;br /&gt;
While setting (WP linear) and (BP linear), observe the histogram. On the left, the histogram should be close to the vertical axis, with no off-gamut values (BP linear). On the right, the histogram should be close to the vertical axis, with no out-of-gamut values (WP linear). &lt;br /&gt;
The setting of (WP linear) is particularly influenced by the activation of Highlight reconstruction.&lt;br /&gt;
I recommend neutralizing the action of GHS - Stretch factor (D) defaults to 0.001, this initializes the system (all other settings default) - so as not to interfere with WP and BP settings and histogram reading. &lt;br /&gt;
In 'Inverse GHS' mode, the White point (WP linear) and Black point (BP linear) settings must be different. For example, a value of 1.8 for (WP linear) will be required in GHS mode and perhaps 0.8 in Inverse GHS mode. In addition, there is interaction between the two settings.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10823</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10823"/>
		<updated>2025-01-22T16:01:55Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Generalized Hyperbolic Stretch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
====Background on the history of digital photography - GHS and Selective Editing====&lt;br /&gt;
There are many different algorithms for processing images. Each of them seeks to solve contradictory problems linked to the difference between human perception - our eye/brain pair - and the data recorded on a camera's digital sensor.&lt;br /&gt;
Some of these algorithms were born at the beginning of the digital era, around 2000. &lt;br /&gt;
A major innovation is the work of Adobe, which designed Photoshop, taking its inspiration from silver photography without actually writing it down, by creating an architecture based on layers and masks. Hence the easy and favorable welcome given to users of black and white film (Kodak, Ilford...) who 'played' with chemistry and enlargers (masks, papers with different grades, developers, etc.). These 'photographic' users are mostly fifty-somethings or more, who have found in this architecture a kind of continuity.&lt;br /&gt;
&lt;br /&gt;
Users have (re)discovered the notions of contrast, luminance, masks (in a new form), blending and so on. Today, this conceptual basis is still the basis of many paid (Capture One, Lightroom...) and free (Darktable, Gimp, ART, ...) software programs. Most of these programs share the same basic logic - even if their ergonomics, processing order and function names differ. Other software packages, such as Capture NX2 (from Nik Software), DxO and Rawtherapee, have chosen a slightly different path, in principle more 'natural' - the notion of 'U-point' linked to color and luminance differences (deltaE) - which, if you look closely, uses the same principle as masks, but in a direct way. In digital photography - unlike film - we don't use the inverted colors used in film photography (negative, enlargers, etc.), but the direct colors recorded on the sensor - or at least their translation into digital values. I'll skip the notions of Bayer matrix, demosaicing... which involve rather complex concepts, far removed from the concerns of the artist photographer (and yet one of the key points of the digital system).&lt;br /&gt;
Since the 1930s, researchers have been asking the question: ’How can we model physical and physiological data in digital concepts that can be used by a photographer or a scientist, in the simplest possible way?’&lt;br /&gt;
&lt;br /&gt;
Several concepts were born and are now used in (almost) all software, often originating from CIE (Commission Internationale de l'Éclairage - in French):&lt;br /&gt;
* RGB data (Red, Green, Blue) - physical data actually present on sensors and inside digital devices (TVs, computers, set-top boxes...) and basic processing .&lt;br /&gt;
* XYZ data - and its xyY variant - which takes into account the colors actually perceived by the human eye, combined with photographers' intuitive / empirical datas: direct light (totality of the CIExy diagram) and reflected light (Pointer gamut). Gamut (color gamut) is a notion closely linked to these datas, both for hardware (camera, monitor, printer, etc.) and for human beings.&lt;br /&gt;
* White balance, i.e. color balance, based on exposure conditions (sun, shade, type of lighting, etc.) and chromatic adaptation.&lt;br /&gt;
* Linear data and gamma - to express the difference between the luminance of the data present on the sensor and that perceived by the eye.&lt;br /&gt;
* Lab data (also used to represent gamut) - originally designed to measure the differences between different colors - but often used as the first model of color appearance. In the Lab domain, the contrast, luminance and chromaticity sliders react perceptually in much the same way as the eye.&lt;br /&gt;
* CIECAM data and processing (as well as its variants with similar concepts, etc.) - colored appearance models (CAM), attempting to take into account the work of researchers to solve some of the problems unsolvable by mathematics alone (notion of simultaneous contrast, surround, etc.). CIECAM is (very) often misunderstood, considered to be a researcher's fad, and yet anyone who has tried and understood it won't want to do without it....for the rest of us, it's a useless gizmo.&lt;br /&gt;
&lt;br /&gt;
Mathematics and science naturally came to the fore to improve digital processing, with problems similar to those encountered with film (noise/grain, color drift and respect, sharpness, distortion, dynamic range, etc.). These mathematics and sciences, always present, are more or less accessible (transparent) to the user and more or less developed: Wavelets, Fourier transform, logarithms, exponentials, hyperbolics, sigmoid, Béziers curves, Laplacians, matrix calculations, convolution, deconvolution, etc. &lt;br /&gt;
When the user doesn't have direct access, or when a simplified vocabulary is used, or when this notion is generally assimilated, we often speak of software for photographers. As if a photographer were, on principle, an artist with minimal knowledge of the physical sciences and phenomena that surround him or her.&lt;br /&gt;
&lt;br /&gt;
When the user has access to it - if only through the vocabulary - we speak of software for engineers.  As if an engineer were in principle a scientist, devoid of any artistic or photographic sense (I don't think I'm devoid of artistic tastes...).&lt;br /&gt;
Nevertheless, certain concepts have (almost) passed into common parlance, even if underneath this used (understood?) vocabulary lie complex principles: Sigmoid, Log encoding, Denoise, Blur, HDR/SDR, Gamut, etc. Are we sure that the photographer of the 1980s-2000s even understands these terms?  The complexity is above all - beyond understanding the scientific phenomenon - a problem of acceptance linked to habits of use, exchanges on forums and discovery of the process by oneself (or with the help of a friend). Little by little, we make a concept our own - without really understanding its foundations. Who among photographers has a clear vision of what gamut or the sigmoid function is (for a doctor, the sigmoid is the terminal part of the intestine)?&lt;br /&gt;
&lt;br /&gt;
Some of the major problems currently addressed by GHS and other advanced products such as Sigmoid, Filmic, TRC, Log Encoding, etc., include :&lt;br /&gt;
* The gap between the dynamics perceived by human beings - in just a few seconds, our eye/brain pair is capable of adapting to the darkness of a church interior and the brightness of sunlit stained-glass windows, and to the nature of the light (sun, tungsten, LED...), and the dynamics linearly present on the camera sensor.&lt;br /&gt;
* Preservation of general contrast, local contrast and saturation when using these algorithms. It's normal for these functions to affect local contrast and saturation as a result of data stretching and compression.&lt;br /&gt;
* The discrepancy between these same dynamics and those of the media used to represent images: smartphones, TVs, monitors, printers.&lt;br /&gt;
* Failures during shooting, either due to technological shortcomings (dynamic range, sensor gamut, etc.), or user-related malfunctions (incorrect settings, blurring, etc.).&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
In short, you need to use the digital data you have on display, the photographic equipment you have at your disposal, and your own knowledge and skills, to arrive as quickly and easily as possible (without too much manipulation and to-ing and fro-ing), at a result that's acceptable to yourself or your interlocutors. Depending on all these factors, some software programs are supposed to be simple and solve (almost) everything with a single click, while others are more complex in their approach, solving a few extra problems. Is the game of complexity worth the candle? To quote a well-known adage: 'A problem is only difficult when you don't know the answer'..., or 'Practice makes perfect'. &lt;br /&gt;
Generalized Hyperbolic Strech (GHS), integrated with Selective Editing (SE), breaks new ground. The algorithm is particularly innovative (I love it). I chose to integrate it with Selective Editing, to work in direct mode. As we'll see later, (GHS) + (SE) makes it easy to combine several 'stretches' in normal GHS or inverse GHS, in 'Global', 'Full image' or 'Normal spot' mode.&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments/fr&amp;diff=10822</id>
		<title>Local Adjustments/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments/fr&amp;diff=10822"/>
		<updated>2024-11-10T15:32:45Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Le module expérimental JzCzHz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Contrôles Locaux Lab&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Texte original rédigé par Jacques Desmis (mise à jour 3 décembre 2022).&lt;br /&gt;
&lt;br /&gt;
Les lecteurs de la version en langue française, peuvent s'étonner de voir les titres des rubriques, champs, bouton à cocher, etc. utiliser la langue anglaise, plutôt que le français, par exemple &amp;quot;Color &amp;amp; Light&amp;quot;, au lieu de &amp;quot;Couleur &amp;amp; Lumière&amp;quot;.&lt;br /&gt;
C'est le résultat d'un compromis, pour plusieurs raisons:&lt;br /&gt;
* la totalité des échanges sur la mise au point de &amp;quot;Ajustements locaux&amp;quot; se fait en anglais (forum, issues, Pull Request), et donc la version à jour est obligatoirement celle en anglais (langue que je maîtrise très mal);&lt;br /&gt;
* je suis le seul rédacteur pour &amp;quot;Ajustements Locaux&amp;quot;, &amp;quot;Local adjustments&amp;quot; de Rawpedia. Bien sûr la première version est rédigée en francais mais les captures d'écrans où on voit apparaître les réglages dans le panneau de droite, doivent être en anglais, car Rawpedia est complexe. Le faire en plusieurs langues m'aurait obligé à le faire aussi en allemand, espagnol, etc., d'où un travail considérable...que je ne sais évidemment pas faire, ce qui est impensable. En conséquence ce qui apparaît est en anglais (outils, curseurs, boites de dialogues, etc.);&lt;br /&gt;
&lt;br /&gt;
Je souhaite bon courage aux traducteurs dans les autres langues!&lt;br /&gt;
&lt;br /&gt;
J'espère que vous comprendrez ce compromis.&lt;br /&gt;
&lt;br /&gt;
Merci&lt;br /&gt;
&lt;br /&gt;
Jacques&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
L'édition locale dans RawTherapee est basée sur des Spot RT, qui sont similaires dans leur principe au concept U-Point utilisé à l'origine dans Nikon Capture NX2, puis dans la Nik Collection, DxO PhotoLab et Capture NXD. Les RT-spots utilisent des algorithmes développés spécifiquement pour RawTherapee par Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Cette approche est complètement différente des méthodes d'édition locales plus familières utilisées dans des applications telles que GIMP, Photoshop, etc., qui utilisent principalement des outils de sélection tels que des lassos, des baguettes magiques, etc., associés à des pinceaux, des calques et des masques de fusion. Ces méthodes peuvent prendre du temps et être difficiles à utiliser avec précision lorsque des formes complexes sont impliquées.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Un point RT se compose soit d'une ellipse, soit d'un rectangle avec un cercle de diamètre variable au centre. Les formes ont quatre points de contrôle, qui peuvent être ajustés indépendamment ou symétriquement. Le spot rectangulaire peut également être utilisé en mode plein écran qui définit automatiquement les points de contrôle en dehors de la zone de prévisualisation de l'image. Les développements futurs fourniront une manipulation de forme améliorée.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
L'algorithme RT-spot utilise une détection de forme basée sur ΔE (le changement de la perception visuelle de deux couleurs données) pour sélectionner les parties de l'image à modifier à l'intérieur de l'ellipse ou du rectangle. Les valeurs de référence utilisées pour l'algorithme de détection de forme sont basées sur la moyenne des valeurs de teinte, de saturation et de luminance à l'intérieur de l'ellipse ou du rectangle de taille variable. Cela signifie qu'en mode plein écran (ainsi qu'en mode Normal ou Exluding), ces valeurs et la détection de forme qui en découle peuvent varier en fonction de la position du cercle.&lt;br /&gt;
&lt;br /&gt;
La mesure dans laquelle ces modifications sont appliquées peut être finement contrôlée permettant des sélections très précises. Un ajout supplémentaire est possible avec des masques paramétriques supplémentaires, mais les algorithmes de détection de forme devraient être suffisants pour la grande majorité des exigences d'édition locales.&lt;br /&gt;
Les RT-spot peuvent également être utilisés en mode &amp;quot;excluding spot&amp;quot; pour empêcher l'algorithme d'influencer certaines parties de l'image.&lt;br /&gt;
Les modifications pouvant être effectuées sont importantes et intègrent la plupart des fonctions disponibles dans les outils de réglage global de RawTherapee ainsi que quelques outils supplémentaires disponibles uniquement dans l'onglet Réglages locaux.&lt;br /&gt;
&lt;br /&gt;
Remarque : tant que la case à cocher &amp;quot;Avoid Color Shift&amp;quot; dans le module Paramètres n'a pas été désactivée, les opérations suivantes seront effectuées sur les données avant et après l'activation de tout RT Spot.&lt;br /&gt;
* Une correction colorimétrique relative pour conserver les données dans le gamut.&lt;br /&gt;
* Une correction Munsell (qui peut être utilisée seule, sans le contrôle du gamut) utilisant des LUT pour garantir que les données restent linéaires et éviter les changements de teinte.&lt;br /&gt;
.&lt;br /&gt;
===Les outils===&lt;br /&gt;
Les outils sont regroupés dans les modules suivants (Nom de l'outil - position dans le pipeline) :&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
Ajuste la couleur, la luminosité, le contraste et corrige les petits défauts tels que les yeux rouges, la poussière du capteur, etc. D'autres fonctions incluent un filtre gradué, des courbes L*a*b* et des modes de fusion.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
Ajuste les ombres et les lumières avec les curseurs d'ombres/lumières, un égaliseur de tonalité (Tone Equalizer) ou une courbe de réponse de tonalité &amp;quot;Tone Response Curve (TRC)&amp;quot;. Peut être utilisé à la place ou en conjonction avec le module d'exposition. Peut également être utilisé comme filtre gradué.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
Ajuste la vibrance (pratiquement identique à l'ajustement global). Effectue l'équivalent d'un réglage de la balance des blancs à l'aide d'un algorithme CIECAM.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
Ajuste les images sous-exposées ou à plage dynamique élevée à l'aide d'un algorithme codé logarithme.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
Modifie l'exposition dans l'espace L*a*b* à l'aide d'un algorithme à base de Laplacien PDE pour prendre en compte deltaE et minimiser les artefacts.&lt;br /&gt;
Les opérateurs laplaciens sont utilisés car ils sont particulièrement bons pour détecter les détails fins mais vous n'avez pas besoin de comprendre leur fonctionnement pour utiliser cet outil !&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
Un outil à part entière. Il permet de régler l'aspect de l'image (chrominance, luminance, contraste) et sa texture en fonction de la portée (Scope).&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
Applique un mélange de lumière douce (identique à l'ajustement global). Effectue un &amp;quot;dodge and burn&amp;quot; en utilisant l'algorithme Retinex original.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
Peut être utilisé pour flouter les arrière-plans, adoucir la peau, ajouter du grain de film et débruiter&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
Identique à l'outil de Tone mapping du menu principal. L'outil du menu principal doit être désactivé si cet outil est utilisé .&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
Dehaze et Retinex (mode avancé uniquement). Utile pour retirer la brume, le contraste local avec des valeurs élevées et la simulation de la &amp;quot;clarté&amp;quot; (clarity).&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
Utilise  RL deconvolution sharpening. Visualiser à 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
Contraste local : essentiellement les mêmes fonctions que le Contraste local de l'onglet Détails.&lt;br /&gt;
Ondelettes : basé sur Niveaux d'ondelettes (wavelet) dans l'onglet Avancé, avec essentiellement les mêmes fonctions (clarté, contraste, flou, etc., voir la documentation). Des fonctions supplémentaires telles que le filtre gradué (Graduated Filter), Tone mapping,  etc. ont également été incluses. Son utilisation dans les Réglages locaux offre des possibilités supplémentaires telles que l'élimination de gros défauts, de taches de graisse, etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
Contrast by detail levels :Peut être utilisé pour éliminer les marques du capteur (graisse,..) ou de l'objectif.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
Ce module est une version simplifiée du module Color Appearance &amp;amp; Lighting(Ciecam02/16) de l'onglet Avancé du menu principal, qui a été adapté aux exigences spécifiques des réglages locaux. Il a également été étendu pour prendre en compte le pic de luminance HDR et inclut une fonction expérimentale JzCzHz (en mode Avancé) pour améliorer le traitement HDR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Chaque module d'outil peut être basculé entre les modes de complexité: basic, standard et advanced. Le mode par défaut peut être défini dans la fenêtre Préférences de RawTherapee.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Comment démarrer - premiers pas==&lt;br /&gt;
Les exemples qui suivent sont conçus pour donner un aperçu de certaines des façons dont les différents outils peuvent être utilisés pour les ajustements locaux. Toutefois, si vous préférez explorer les possibilités par vous-même, essayez de régler la &amp;quot;complexité par défaut des ajustements locaux&amp;quot; dans le module Préférences sur Basic et décochez la case &amp;quot;Afficher les paramètres supplémentaires&amp;quot; en haut du module Ajustements locaux. Vous obtiendrez ainsi une version simplifiée mais puissante des ajustements locaux. &lt;br /&gt;
&lt;br /&gt;
De mon point de vue, Basic est le mode qui correspond le mieux (absence de masques et généralement de courbes) à mon intention initiale en 2015.&lt;br /&gt;
&lt;br /&gt;
Pour commencer, explorez les capacités des outils &amp;quot;Color &amp;amp; Light&amp;quot;, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; et &amp;quot; Vibrance &amp;amp; Warm/Cool &amp;quot; et n'hésitez pas à essayer les fonctionnalités supplémentaires en réglant manuellement le mode de complexité sur Standard (dans la boîte combo du module sur lequel vous travaillez).&lt;br /&gt;
&lt;br /&gt;
L'outil Color &amp;amp; Light est extrêmement puissant et comprend des fonctions du module &amp;quot;Coor Toning &amp;gt; Color corrections Région&amp;quot; dans l'onglet Couleur du menu principal ainsi que les courbes L*a*b* disponibles dans l'onglet Exposition.&lt;br /&gt;
Remarque : les captures d'écran des exemples suivants sont actuellement mises à jour pour tenir compte des derniers développements. De ce fait, certains noms de curseurs et de modules seront différents du texte.&lt;br /&gt;
===Premiers pas===&lt;br /&gt;
&lt;br /&gt;
====Démarrage====&lt;br /&gt;
* Dans la barre des onglets, sélectionnez la &amp;quot;main&amp;quot; (Onglet Local)&lt;br /&gt;
* Puis activez &amp;quot;expander&amp;quot; &amp;quot;Local Adjustments&amp;quot; (si il n'est pas déjà activé)&lt;br /&gt;
*Sélectionnez &amp;quot;Add&amp;quot;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
Fichier raw  (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Préparation====&lt;br /&gt;
Positionnez le RT-spot à l'endroit souhaité. Dans ce cas, je souhaite accroître la saturation de la fleur rouge et réduire la luminance (lightness) sans affecter le reste de l'image:&lt;br /&gt;
* déplacez le centre du RT-spot de telle manière que son centre soit situé sur une zone représentative de ce que vous souhaitez changer.&lt;br /&gt;
* positionnez les 4 délimiteurs largement au delà de la fleur.&lt;br /&gt;
* sélectionnez le &amp;quot;Lockable color picker&amp;quot; et repérez 3 couleurs : a) une sur la fleur rouge, b) une sur le ciel bleu, c) une sur une feuille verte&lt;br /&gt;
* Dans l'exemple les 3 couleurs sont:&lt;br /&gt;
** fleur rouge L=48.6 a=74.4 b=47.0&lt;br /&gt;
** ciel bleu : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** feuille verte : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
====Ajouter l'outil Color &amp;amp; Light====&lt;br /&gt;
Voir dans &amp;quot;Quelques particularités du mode local (par rapport à Lab adjustments)&amp;quot;: [[Local Lab controls/fr#Color &amp;amp; Light| Particularités Color &amp;amp; Light]]&lt;br /&gt;
&lt;br /&gt;
Dans le menu settings, choisissez &amp;quot;Add tool to current spot...&amp;quot;&lt;br /&gt;
* une liste de choix vous est proposée : &amp;quot;Color&amp;amp;light 11&amp;quot;,..., &amp;quot;Log Encoding 0&amp;quot;. Pour chaque RT-spot vous pouvez associer 1 ou plusieurs outils de la liste. L'ordre de traitement dans le processus correspond au numéro à la fin du choix : &amp;quot;Encoding Log - 0&amp;quot; est le premier traitement (si bien sûr il est activé), &amp;quot;Color&amp;amp;light(defects) -11&amp;quot; est le dernier. Ceci est également vrai pour les masques associés.&lt;br /&gt;
* sélectionnez &amp;quot;Color &amp;amp; Light (Defects) - 11&amp;quot;&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Ajouter l'outil Color and Light]]&lt;br /&gt;
&lt;br /&gt;
====Réglez la luminance (lightness) et la chrominance====&lt;br /&gt;
* réglez la luminance sur -70&lt;br /&gt;
* réglez la chrominance sur 130&lt;br /&gt;
&lt;br /&gt;
* Examinez les résultats&lt;br /&gt;
* la fleur rouge a une nouvelle couleur L=41.3 a=66.0 b=50.4&lt;br /&gt;
* le ciel est inchangé&lt;br /&gt;
* la feuille verte est inchangée&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Réglez luminance et chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Essayez Scope Color Tools - Transition====&lt;br /&gt;
Dans le menu &amp;quot;settings&amp;quot;&lt;br /&gt;
* Agissez sur &amp;quot;Scope Color Tools&amp;quot;&lt;br /&gt;
** si vous réduisez la valeur (par défaut 30) seule une partie des rouges sera concernée.&lt;br /&gt;
** si vous accroissez la valeur, progressivement le ciel, puis la feuille verte, puis toute l'image sera concernée (Scope=100)&lt;br /&gt;
Laissez la valeur Scope à 100 et dans le menu &amp;quot;settings&amp;quot;&lt;br /&gt;
* Agissez sur transition:&lt;br /&gt;
** essayez de réduire vers 5 &lt;br /&gt;
** essayez d’accroître vers 100 et constatez le résultat&lt;br /&gt;
&lt;br /&gt;
====Prévisualisez la zone modifiable - deltaE - ΔE====&lt;br /&gt;
Vous pouvez avoir un aperçu des zones de l'image qui seront touchées par les modifications - cela ne montre pas les modifications, ni les transitions, mais permet de régler &amp;quot;Scope&amp;quot;.&lt;br /&gt;
Deux possibilités:&lt;br /&gt;
* utiliser le bouton &amp;quot;Preview ΔE&amp;quot; situé dans &amp;quot;settings&amp;quot; et un et seulement un, outil doit être activé (expander)&lt;br /&gt;
* utiliser dans &amp;quot;Mask and modifications&amp;quot; - &amp;quot;Preview deltaE&amp;quot; - dans ce cas le GUI prend en compte l'état des outils - cette option fonctionne quelque soit le nombre d'outils activés.&lt;br /&gt;
Vous pouvez faire varier l'intensité et la couleur de cette prévisualisation avec &amp;quot;ΔE preview color - Intensity&amp;quot;&lt;br /&gt;
Vous pouvez aussi voir l'action des divers réglages possibles relatif à la détection de forme : essayez les curseurs de &amp;quot;Shape detection&amp;quot; à l'exception de Threshold structure. &lt;br /&gt;
 &lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Prévisualisez les zones modifiables]]&lt;br /&gt;
&lt;br /&gt;
====Voir les modifications====&lt;br /&gt;
Vous pouvez avoir un aperçu des modifications que vous avez réalisées:&lt;br /&gt;
* Allez à &amp;quot;Mask and modifications&amp;quot; - &amp;quot;Show modifications without mask&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* vous pouvez visualiser les incidences de la luminance, du contraste, des changements de couleurs et saturation, structures,...&lt;br /&gt;
* vous pouvez aussi visualiser l'incidence des réglages de la transition (settings) :&lt;br /&gt;
** transition value : pourcentage géographique entre pleine action et action décroissante (jusque zéro)&lt;br /&gt;
** transition decay (linear-log) : &amp;quot;vitesse&amp;quot; d'affaiblissement de la zone d'action décroissante&lt;br /&gt;
** transition différentiation XY : différence entre abscisse et ordonnée&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Essayez ici tous les réglages:&lt;br /&gt;
* ceux de Scope (deltaE)&lt;br /&gt;
* ceux des transitions&lt;br /&gt;
* les réglages de l'outil (luminance, chroma, etc.) &lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Voir les zones modifiées]]&lt;br /&gt;
&lt;br /&gt;
====Travailler en Image entière et utiliser &amp;quot;excluding&amp;quot; spot====&lt;br /&gt;
Local adjustments ne se limite pas aux retouches locales. Vous pouvez  profiter des ressources de ce module pour traiter l'image entière.&lt;br /&gt;
Actuellement ce mode est &amp;quot;manuel&amp;quot;, une automatisation du GUI est prévue...&lt;br /&gt;
&lt;br /&gt;
Choisissez dans &amp;quot;settings&amp;quot; :&lt;br /&gt;
* Shape RT-spot area = rectangle&lt;br /&gt;
* positionnez les 4 délimiteurs en dehors de la prévisualisation (preview)&lt;br /&gt;
* réglez la transition sur 100 (ou une autre valeur si vous le souhaitez... pour générer un gradient), mais il y a d'autres outils pour réaliser des gradients!&lt;br /&gt;
Vous êtes prêts maintenant pour utiliser l'ensemble des outils en mode pleine image&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Travailler en image entière - réglages]]&lt;br /&gt;
&lt;br /&gt;
====Combinaison d'outils avec un seul RT-spot====&lt;br /&gt;
La plupart des outils d'ajustement local peuvent être utilisés ensemble dans le même RT-Spot. Cependant, les combinaisons de Log Encoding, Tone Mapping et Retinex doivent être évitées. En effet, le fichier de sortie TIFF ou JPG peut ne pas correspondre à l'aperçu, en particulier lorsque celui-ci a été agrandi à l'aide de la fonction zoom.&lt;br /&gt;
&lt;br /&gt;
L'association de l'un des outils ci-dessus avec les autres outils d'ajustement local, tels que Color &amp;amp; Light, ne pose pas de problème.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser des combinaisons des 3 outils mentionnés ci-dessus, vous pouvez simplement ajouter un autre RT-Spot à proximité du premier.&lt;br /&gt;
&lt;br /&gt;
Par exemple, le premier RT-Spot pourrait être consacré à Log Encoding, et le second à la cartographie des tons ou au Retinex. D'autres outils peuvent être ajoutés à l'un ou l'autre des deux points RT selon les besoins.&lt;br /&gt;
&lt;br /&gt;
===Exemples concrets===&lt;br /&gt;
&lt;br /&gt;
====Changer la couleur des feuilles vertes - sauf une====&lt;br /&gt;
=====Changer le couleur des feuilles=====&lt;br /&gt;
* L'utilisation des composantes &amp;quot;a&amp;quot; et &amp;quot;b&amp;quot; de &amp;quot;Lab&amp;quot; dans &amp;quot;Color grid correction&amp;quot;, en choisissant &amp;quot;direct&amp;quot; et une valeur élevée de &amp;quot;Strength&amp;quot;, amène un changement de couleur de toutes les feuilles. &lt;br /&gt;
* Vous pouvez adapter si nécessaire avec &amp;quot;Scope color tools&amp;quot;&lt;br /&gt;
* Les autres couleurs : fleur, ciel ne sont pas modifiées&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changer la couleur des feuilles]&lt;br /&gt;
&lt;br /&gt;
=====Une des feuilles redevient verte=====&lt;br /&gt;
* Ajouter un deuxième RT-spot (add)&lt;br /&gt;
* choisir Spot Method = Excluding Spot&lt;br /&gt;
* déplacer le RT-spot vers la feuille à conserver - encadrer largement&lt;br /&gt;
* agir sur &amp;quot;Scope excluding&amp;quot; (settings) jusqu'à obtenir l'effet désiré&lt;br /&gt;
* vous pouvez utiliser le &amp;quot;Excluding spot&amp;quot; comme un RT-spot normal et si nécessaire utiliser tous les outils disponibles notamment Denoise, Blur, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Usage de Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Traiter les yeux rouges - retirer les défauts du capteur====&lt;br /&gt;
Voir dans &amp;quot;Cas d'usage spécifique : réduction des défauts&amp;quot;: [[Local Lab controls/fr#Cas d'usage spécifique : réduction des défauts (capteur sale, yeux rouges, ...)| Réduction des défauts]]&lt;br /&gt;
&lt;br /&gt;
Traiter les yeux rouges  - 3 étapes : préparation, régler le RT-spot, supprimer le rouge&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* Choisissez une sélection large autour de l’œil&lt;br /&gt;
* mettez le RT-spot sur la zone rouge de l’œil (pupille)&lt;br /&gt;
* mettez 4 &amp;quot;Lockable color pickers&amp;quot; pour repérer les changements&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
=====Régler le RT-spot=====&lt;br /&gt;
* Ajoutez l'outil &amp;quot;Color &amp;amp; light&amp;quot;&lt;br /&gt;
* Pressez le  bouton dans &amp;quot;Settings&amp;quot; &amp;quot;Preview deltaE&amp;quot;&lt;br /&gt;
* Réglez le RT-spot pour obtenir l'effet désiré au niveau de la sélection&lt;br /&gt;
** Ici j'ai choisi de réduire la taille du centre (Spot size) = 14&lt;br /&gt;
** Scope color tools = 18&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Supprimer le rouge=====&lt;br /&gt;
* dans l'outil &amp;quot;Color &amp;amp; light&amp;quot;, réduisez la chrominance à -100&lt;br /&gt;
* examinez le résultat :&lt;br /&gt;
** la pupille de l’œil n'a quasiment plus de dominante de couleur&lt;br /&gt;
** l'iris, la cornée et la peau du visage sont inchangés&lt;br /&gt;
** vous pouvez être amenés selon les cas, à changer les valeurs des &amp;quot;transitions&amp;quot; (plus faibles) et &amp;quot;transition decay&amp;quot; plus élevée&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye whithout Red]]&lt;br /&gt;
&lt;br /&gt;
=====Même démarche pour retirer les défauts de capteur ou les taches=====&lt;br /&gt;
Vous pouvez utiliser le même principe pour retirer les petits défauts de capteur, mais avec d'autres outils&lt;br /&gt;
* soit avec Contrast By Detail Levels)&lt;br /&gt;
* soit avec Wavelet pyramid2 - Contrast by levels&lt;br /&gt;
* dans les 2 cas, réduisez le contraste pour les bas niveaux de décomposition&lt;br /&gt;
* agissez éventuellement sur Blur levels (wavelet pyramid1)&lt;br /&gt;
* Utilisez de faibles valeurs de &amp;quot;transition&amp;quot; (moins de 20) et d'importantes valeurs de &amp;quot;transition decay&amp;quot; (plus de 15)&lt;br /&gt;
* la taille minimale du RT-spot dans ces 2 cas est de 32x32 - ce qui n'a que peu d'incidences&lt;br /&gt;
======Un exemple - retirer de nombreuses taches avec wavelet pyramid2======&lt;br /&gt;
* constat&lt;br /&gt;
 [[File:Blotches.jpg|600px|thumb|center|Many blotches]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* une solution possible&lt;br /&gt;
* activez l'outil &amp;quot;local contrast - wavelets&amp;quot;&lt;br /&gt;
* choisissez &amp;quot;advanced&amp;quot;, puis &amp;quot;wavelet&amp;quot;&lt;br /&gt;
* réglez scope vers 20&lt;br /&gt;
* allez dans Pyramid2 et activez &amp;quot;Contrast by level&amp;quot;&lt;br /&gt;
* réglez avec des valeurs élevées de &amp;quot;Attenuation Response&amp;quot;, &amp;quot;Offset&amp;quot;, &amp;quot;Chroma levels&amp;quot; (si nécessaire)&lt;br /&gt;
* activez la courbe &amp;quot;Contrast by level&amp;quot; en réduisant le contraste pour les faibles niveaux. &lt;br /&gt;
&lt;br /&gt;
 [[File:Blotchesless1.jpg|600px|thumb|center|less blotches]]&lt;br /&gt;
&lt;br /&gt;
====Comment réaliser un Dodge and burn (Éclaircir et brûler)====&lt;br /&gt;
Voir dans &amp;quot;Quelques particularités du mode local (par rapport à Lab adjustments)&amp;quot;:[[Local Lab controls/fr#Original Retinex| Original Retinex]]&lt;br /&gt;
&lt;br /&gt;
Dans beaucoup de portraits, ou de photos où la peau est exposée à la lumière, il se produit un phénomène peu agréable d'accroissement de contraste, certaines parties de la peau sont légèrement surexposées, alors que d'autres sont légèrement sous exposées.&lt;br /&gt;
* traditionnellement ce problème est traité avec des masques et des calques - il est existe de nombreux tutoriels avec Photoshop (C). Vous pouvez aussi probablement le traiter avec les masques incorporés dans RT &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
* d'autres techniques permettent un traitement  localisé avec des brosses, faisant ou non appel à des processus automatiques de traitement.&lt;br /&gt;
* ce que je propose ici est tout autre, il s'agit d'utiliser le concept de &amp;quot;Original Retinex&amp;quot; (Provient de la recherche Ipol) - ce pourquoi a été élaboré Retinex dans les années 1970 et non l'usage qui en a été fait ailleurs - y compris ici dans Rawtherapee:&lt;br /&gt;
** utiliser un ou plusieurs Laplaciens à seuil réglable&lt;br /&gt;
** résoudre l'équation de Poisson (PDE - Équation aux dérivées partielles)&lt;br /&gt;
** équilibrer les luminances.&lt;br /&gt;
&lt;br /&gt;
Je ferais la démonstration en 3 étapes : préparation, réglages du Laplacien et aperçu des modifications, résultat&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* Je ne reprendrais pas les étapes de réglage du deltaE (attention à utiliser le Scope de Original Retinex), ni des transitions, les principes  sont identiques aux exemples précédents&lt;br /&gt;
* j'ai choisi un portrait, mais par souci de confidentialité j'ai masqué les yeux.&lt;br /&gt;
* choisir &amp;quot;Add tool to current spot...&amp;quot; : &amp;quot;Soft Light - Original Retinex&amp;quot; - &amp;quot;Advanced&amp;quot; - &amp;quot;Original Retinex&amp;quot;&lt;br /&gt;
 [[File:Dodgeburn1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
 &lt;br /&gt;
=====Réglages du Laplacien et aperçu des modifications=====&lt;br /&gt;
* Agir sur le curseur : Strength (qui prend en compte  le seuil du premier Laplacien)&lt;br /&gt;
* Agir sur le curseur : Laplacian threshold deltaE (qui prend en compte le deltaE de l'image pour agir sur un deuxième Laplacien). Ce traitement est en amont des algorithmes Scope - et peut prendre en compte les différences dans les arrières plans...&lt;br /&gt;
* Visualiser les modifications en choisissant: &amp;quot;Show process Fourier&amp;quot; : &amp;quot;show modifications without mask&amp;quot;&lt;br /&gt;
 [[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Résultats=====&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Résultats]]&lt;br /&gt;
Un algorithme similaire est utilisé dans &amp;quot;Exposure&amp;quot; - Laplacian PDE IPOL Contrast attenuator&amp;quot; - il permet de traiter des images avec d'importants écarts d'exposition, souvent globalement sous-exposées.&lt;br /&gt;
&lt;br /&gt;
====Réaliser un &amp;quot;Graduated Filter&amp;quot; Luminance - Chrominance et Teinte (filtre dégradé)====&lt;br /&gt;
A voir dans Principes généraux [[Local Lab controls/fr#Algorithme complémentaire : Graduated Filter - GF| Graduated Filter Luminance Chrominance Teinte]]&lt;br /&gt;
&lt;br /&gt;
Toujours à titre de démonstration, je vais utiliser les possibilités de réaliser un Filtre dégradé à la fois pour la luminance, la chrominance et le teinte (hue).&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* je choisis l'image qui a servi au démarrage&lt;br /&gt;
* Je repère 7 points avec un &amp;quot;Lockable color picker&amp;quot;&lt;br /&gt;
* Add tool to current spot...&amp;quot; - &amp;quot;Color &amp;amp; Light&amp;quot; - &amp;quot;Advanced&amp;quot;&lt;br /&gt;
 [[File:gradprepa1.jpg|600px|thumb|center|Préparation]] &lt;br /&gt;
Fichier raw (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Réaliser un &amp;quot;Graduated Filter&amp;quot;=====&lt;br /&gt;
Arbitrairement je choisis les réglages suivants&lt;br /&gt;
* Gradient strength luminance : -0.44&lt;br /&gt;
* Gradient strength Chrominance : -1.13&lt;br /&gt;
* Gradient strength Hue : 2.69&lt;br /&gt;
* Gradient angle : -87.6&lt;br /&gt;
* Scope color tools = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
 [[File:gradLCH1.jpg|600px|thumb|center|Gradient Luminance Chrominance Hue]] &lt;br /&gt;
 &lt;br /&gt;
=====Changer les réglages par défaut=====&lt;br /&gt;
* Essayez de changer progressivement &amp;quot;Scope color Tools&amp;quot;, portez le à 70, 75, 80, 85, 90, 100&lt;br /&gt;
* Changez &amp;quot;Feather&amp;quot; et notez les variations&lt;br /&gt;
* Bien sûr vous pouvez aussi changer les valeurs des gradients (L, C, H, angle)&lt;br /&gt;
* et aussi si vous le souhaitez les valeurs de &amp;quot;Color and light&amp;quot;&lt;br /&gt;
 [[File:gradLCHScopeFeather1.jpg|600px|thumb|center|Gradient Luminance Chrominance Hue - Scope Feather]]&lt;br /&gt;
&lt;br /&gt;
====Cinq manières de changer l'exposition - relever les ombres - Évaluer la Dynamique Range - DR====&lt;br /&gt;
Voir dans: Quelques particularités du mode local (par rapport à Lab adjustements)- Shadows/Hightligt &amp;amp; Tone Equalizer [[Local Lab controls/fr#Shadows Highlight&amp;amp; Tone Equalizer| Shadows/Highlights &amp;amp; Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
Cette démonstration est uniquement à caractère pédagogique, pour montrer les diverses possibilités (non exhaustives) en matière de traitement de l'exposition. Mes choix sont arbitraires. &lt;br /&gt;
* J'ai choisi de le faire avec une image difficile, ombre accentuées avec au centre une zone proche des limites d'exposition.&lt;br /&gt;
* Cinq méthodes sont juste &amp;quot;montrées&amp;quot; avec des réglages arbitraires&lt;br /&gt;
** Shadows/Highlight&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (Dynamic Range &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
J'aurais pu aussi utiliser :&lt;br /&gt;
* des courbes de contraste,&lt;br /&gt;
*  ou relever les ombres avec &amp;quot;Lightness&amp;quot; (Color &amp;amp; Light)&lt;br /&gt;
* ou utiliser un Graduated Filter Luminance&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* par défaut j'ai réglé Scope à 50 (&amp;quot;Scope color tools&amp;quot; pour Shadows/Highlight&amp;quot;, mais aussi Scope pour Log Encodinh, Scope pour Exposure)&lt;br /&gt;
* Essayez de faire varier cette valeur de 20 à 100&lt;br /&gt;
 [[File:shadows-prepa.jpg|600px|thumb|center|Relever les ombres - préparation]]&lt;br /&gt;
Fichier raw (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Add tool to current spot...&amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;&lt;br /&gt;
* Shadows/Highlight&lt;br /&gt;
* essayez de changer &amp;quot;Shadows tonal width&amp;quot;...et &amp;quot;Highlight&amp;quot;&lt;br /&gt;
 [[File:shadows-sh.jpg|600px|thumb|center|Relever les ombres - Shadows Highlight]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Tone Equalizer=====&lt;br /&gt;
 Add tool to current spot...&amp;quot;Shadows/Highlight &amp;amp; Tone Equalizer&amp;quot;&lt;br /&gt;
* Tone Equalizer&lt;br /&gt;
* essayez les curseurs 2, 3 et 4&lt;br /&gt;
 [[File:shadows-toneeq.jpg|600px|thumb|center|Relever les ombres - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser TRC=====&lt;br /&gt;
 Add tool to current spot...&amp;quot;Shadows/Highlight &amp;amp; Tone Equalizer&amp;quot; au moins en mode &amp;quot;Standard&amp;quot;&lt;br /&gt;
* TRC&lt;br /&gt;
* augmentez &amp;quot;slope&amp;quot; jusque 150....revenez à 60&lt;br /&gt;
* essayez de diminuer gamma et de l'accroître&lt;br /&gt;
 [[File:shadows-trc.jpg|600px|thumb|center|Relever les ombres - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Log Encoding=====&lt;br /&gt;
 Add tool to current spot...&amp;quot;Log Encoding&amp;quot;&lt;br /&gt;
* Attention le &amp;quot;scope&amp;quot; à utiliser est celui de &amp;quot;Log encoding&amp;quot; : scope = 50&lt;br /&gt;
* cliquez sur le bouton &amp;quot;Automatic&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Target grey point&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 [[File:shadows-elog.jpg|600px|thumb|center|Relever les ombres - Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Exposure=====&lt;br /&gt;
Add tool to current spot... &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;&lt;br /&gt;
* Choisissez &amp;quot;standard&amp;quot;&lt;br /&gt;
* Réglez &amp;quot;Exposure compensation ƒ&amp;quot; (un Laplacien et une transformée de Fouriers sont appliqués en amont de Exposure) &lt;br /&gt;
* j'ai réglé des curseurs de &amp;quot;Tools exposure&amp;quot; : black à -1500, shadows à 50&lt;br /&gt;
* par défaut &amp;quot;Highlight compression&amp;quot; est à 20, faites varier&lt;br /&gt;
* essayez en neutralisant ces réglages&lt;br /&gt;
* essayez d'autres réglages de &amp;quot;Tools exposure&amp;quot;&lt;br /&gt;
 [[File:shadows-expo.jpg|600px|thumb|center|Relever les ombres - Exposure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Recommandations=====&lt;br /&gt;
Pour les portraits et les images à faible gradient de couleurs:&lt;br /&gt;
* utiliser &amp;quot;Exposure&amp;quot; avec précautions, dans ce cas des portraits (skin), ainsi que ceux avec une faible variation de couleurs, l'algorithme proche de celui de &amp;quot;exposure compensation main&amp;quot; est peu approprié, il vient d'être amélioré (5 juillet 2020) par l'ajout d'un Laplacien pour résoudre les différences de contraste. &lt;br /&gt;
&lt;br /&gt;
Malgré les améliorations et d'une manière générale: &lt;br /&gt;
* l'algorithme &amp;quot;Exposure&amp;quot; est peu performant, mais les utilisateurs ont l'habitude de l'utiliser. J'ai été amené à mettre en place des palliatifs pour le rendre convenable;&lt;br /&gt;
* lui préférer (solutions les plus simples):&lt;br /&gt;
** Tone Equalizer - dans Shadows/Highlight &amp;amp; Tone Equalizer&lt;br /&gt;
** Tone Response Curve (TRC) - lui aussi dans dans Shadows/Highlight &amp;amp; Tone Equalizer (Equalizer en mode &amp;quot;Standard&amp;quot;). N'hésitez pas à accroître &amp;quot;Slope&amp;quot; pour déboucher linéairement les ombres. Vous pouvez agir sur le gamma pour éclaircir les zone claires.&lt;br /&gt;
&lt;br /&gt;
Si néanmoins vous souhaitez utiliser &amp;quot;exposure&amp;quot;,je recommande - non obligatoire - de changer dans &amp;quot;settings&amp;quot; les paramètres de &amp;quot;Shape detection&amp;quot;&lt;br /&gt;
* accroître &amp;quot;Threshold ΔE scope&amp;quot;&lt;br /&gt;
* réduire &amp;quot;ΔE decay&amp;quot;&lt;br /&gt;
* régler &amp;quot;Balance ΔE ab-L&amp;quot; vers L&lt;br /&gt;
* adapter Scope si nécessaire&lt;br /&gt;
&lt;br /&gt;
=====Évaluer la Dynamic Range des outils en termes de Dynamic Range (DR)=====&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Image d'origine - 25Ev - sans traitement======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* la DR noir et blanc restituée est d'environ 12 à 13 Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Log encoding======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR couleur et noir et blanc restituée est de 25Ev&lt;br /&gt;
* Noter l'utilisation de &amp;quot;White distribution = 90&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=80.9 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la  DR couleur et noir et blanc restituée est de 25Ev&lt;br /&gt;
* Noter l'utilisation de &amp;quot;White distribution = 100&amp;quot; et &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
A noter la différence avec Log encoding, qui est due à l'action de Ciecam et change la répartition des lumières. &lt;br /&gt;
* Agir sur le gamma de la TRC restitue sensiblement l'image Log Encoding ci-dessus.&lt;br /&gt;
* Ou agir sur Contrast J et Luminance J restitue sensiblement l'image Log Encoding ci-dessus.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|Avec Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Tone Equalizer======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=82 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est un peu pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 15Ev à 18Ev&lt;br /&gt;
* Noter l'utilisation de un cinquième slider pour traiter les très hautes lumières : 5(lightest) = -100&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|Avec Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=4 à L=95.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance et selon les couleurs (dérive de couleurs dans les bleus). L*a*b*, la Dynamic Range est un peu pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 17Ev à 20Ev&lt;br /&gt;
* notez la complexité et le peu d'intuitivité des actions et le temps de traitement important&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|Avec Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Dehaze======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=88 (échelle 0 - 100), les ombres sont peu débouchées&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 15Ev à 16Ev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|Avec Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=70 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 12Ev à 14Ev&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|Avec Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Tone Response Curve - TRC======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=95.6 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est un peu pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 12Ev à 16Ev&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|Avec TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=70.9 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas fidèles, ni uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est très pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 11Ev à 14Ev&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|Avec Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Local Adjustments - Tone Mapping======&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent une partie de la plage visible de L=1 à L=72.4 (échelle 0 - 100)&lt;br /&gt;
* les couleurs ne semblent pas uniformément réparties selon la luminance. L*a*b*, la Dynamic Range est très pénalisée&lt;br /&gt;
* la DR noir et blanc et couleur restituée est sensiblement de 10Ev à 14Ev&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|Avec Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Synthèse======&lt;br /&gt;
* Les outils utilisant l'algorithme &amp;quot;Log encoding&amp;quot; - comme &amp;quot;LA Log encoding&amp;quot; ou &amp;quot;LA Color-Appearance Cam16&amp;quot; ont une restitution maximale et totale des couleurs et de la dynamic range (DR), mais leur utilisation n'est pas intuitive.&lt;br /&gt;
* &amp;quot;LA Tone Equalizer&amp;quot; assure une assez bonne restitution pour cette image. L'outil doit convenir pour une majorité d'images issues d'appareils photos. Il est intuitif mais nécessite au moins 5 réglages.&lt;br /&gt;
* &amp;quot;LA Dynamic Range &amp;amp; Exposure&amp;quot; a une restitution de la DR très bonne, certaines couleurs subissent des dérives. Les réglages sont peu intuitifs, le système est lent. &lt;br /&gt;
* &amp;quot;LA TRC&amp;quot; assure une restitution moyenne pour cette image. L'outil doit convenir pour beaucoup d'images issues d'appareils photos. L'utilisation est simple et intuitive.&lt;br /&gt;
* &amp;quot;LA Dehaze&amp;quot; peut être apporter un traitement significatif de la DR, si il est utilisé par ailleurs, par exemple pour ce qu'il est conçu, le traitement de la brume.&lt;br /&gt;
* Les autres outils, &amp;quot;LA Exposure&amp;quot;, &amp;quot;LA Shadows/Highlights&amp;quot; ne sont que de peu d'intérêt pour la DR.&lt;br /&gt;
* Curieusement 1 outils &amp;quot;dédié&amp;quot; (en théorie) à la DR - &amp;quot;LA Tone Mapping&amp;quot; n'a pas de bons résultats.&lt;br /&gt;
&lt;br /&gt;
====Traitement d'une image brumeuse====&lt;br /&gt;
Quelques explications dans &amp;quot;Quelques questions&amp;quot; : [[Local Lab controls/fr#A quoi sert l'association Retinex - Dehaze ?| Association Retinex - Dehaze]]&lt;br /&gt;
&lt;br /&gt;
Je prendrais l'exemple d'une image très brumeuse et appliquerais en première étape le traitement &amp;quot;Dehaze&amp;quot; du main menu&lt;br /&gt;
Puis je continuerais le traitement avec un complément pour le ciel et l'horizon, avec Retinex local&lt;br /&gt;
=====Image originale=====&lt;br /&gt;
 [[File:haze.jpg|600px|thumb|center|Image brumeuse]]&lt;br /&gt;
Fichier raw (Pixls.us -  Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Traitement avec Dehaze (main)=====&lt;br /&gt;
J'aurais pu le faire avec &amp;quot;dehaze local&amp;quot; (Dehaze &amp;amp; Retinex) ...et un RT-spot!&lt;br /&gt;
Mais examinez l’arrière plan, les collines...il reste beaucoup de brume&lt;br /&gt;
 [[File:haze-dehaze.jpg|600px|thumb|center|Image brumeuse - dehaze main]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Complément avec Retinex local=====&lt;br /&gt;
* Choisir &amp;quot;add tools to current spot..&amp;quot; : Dehaze - Retinex - &amp;quot;advanced&amp;quot;&lt;br /&gt;
* Essayer plusieurs réglages par itérations successives&lt;br /&gt;
* agissez si nécessaire avec la courbe &amp;quot;transmission map&amp;quot;...avec un affaiblissement de la courbe à droite...&lt;br /&gt;
* examinez maintenant les collines et le ciel à l'horizon !&lt;br /&gt;
 [[File:haze-reti1.jpg|600px|thumb|center|Image brumeuse - dehaze + retinex]]&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser le module &amp;quot;Denoise&amp;quot;====&lt;br /&gt;
Voir dans &amp;quot;Quelques particularités du mode local (par rapport à Lab adjustements) [[Local Lab controls/fr#Denoise | Denoise]]&lt;br /&gt;
&lt;br /&gt;
Plusieurs utilisations sont possibles. &lt;br /&gt;
* en complément sur certaines zones du module &amp;quot;denoise main&amp;quot;, dans ce cas les réglages de &amp;quot;denoise main&amp;quot; seront réalisés a minima&lt;br /&gt;
* en traitant toute l'image en mode &amp;quot;local adjustments&amp;quot; - &amp;quot;Denoise&amp;quot; et en excluant une zone avec &amp;quot;excluding&amp;quot;&lt;br /&gt;
* pris isolément pour réduire le bruit dans des images peu bruitées - par exemple pour retirer le bruit d'un ciel, ou d'un visage&lt;br /&gt;
* pris isolément pour traiter le bruit dans une zone choisie et en le laissant volontairement dans le reste de l'image, à des fins artistiques&lt;br /&gt;
C'est ce dernier cas que je vais expliciter.&lt;br /&gt;
&lt;br /&gt;
L'image de la jeune fille est particulièrement bruitée avec un fort bruit chromatique&lt;br /&gt;
 [[File:denoise-prepa1.jpg|600px|thumb|center|Denoise préparation]]&lt;br /&gt;
Fichier raw (Copyright Ian Burley -  Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
 [[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Quels réglages pour denoise ?=====&lt;br /&gt;
* la position du spot, sa taille ont de l'importance : j'ai choisi une zone du visage avec un fort bruit chromatique et un assez gros RT-spot &amp;quot;spot size&amp;quot;&lt;br /&gt;
* le choix de scope est important : dans ce cas - où le bruit occupe quasiment tout le spectre coloré (rouge, vert, bleu, jaune) il faut choisir une valeur élevée de scope (ici 90). Si, avec une autre image, le traitement du bruit concernait uniquement la luminance il faudrait choisir la valeur de scope &amp;quot;habituelle&amp;quot;, soit aux environs de 30, pour permettre à l'algorithme de différencier l'action selon les couleurs.&lt;br /&gt;
* par rapport à &amp;quot;denoise main&amp;quot; plusieurs changements:&lt;br /&gt;
** possibilité de régler le débruitage luminance en fonction du niveau de détail (de 0 à 6 selon la position sur l'abscisse de la courbe), à l'aide d'une courbe&lt;br /&gt;
** une différentiation est faite en fonction du niveau de détail : si les niveaux 3 et au-dessus sont supérieurs à 20% de l'ordonnée de la courbe, il en résultera une action plus destructive sur la luminance. &lt;br /&gt;
** la différenciation &amp;quot;sombre - clair&amp;quot; pour la luminance est traitée par un &amp;quot;equalizer&amp;quot;, plutôt que par &amp;quot;gamma&amp;quot;&lt;br /&gt;
** possibilité de différencier l'action entre &amp;quot;chroma fine&amp;quot; (bruit d'impulsion, bruit faible de chrominance...niveaux de 0 à 4) et &amp;quot;chroma coarse&amp;quot; (paquets, bloatches..niveaux 5 et 6)&lt;br /&gt;
** l'algorithme &amp;quot;chroma&amp;quot; utilise une action plus destructive, si le curseur &amp;quot;coarse&amp;quot; est supérieur à 20.&lt;br /&gt;
** un &amp;quot;equalizer&amp;quot; &amp;quot;rouge vert&amp;quot; / &amp;quot;bleu jaune&amp;quot; peut être utile pour les images faiblement bruitées &lt;br /&gt;
** ajout d'un curseur &amp;quot;chroma detail recovery&amp;quot; - utilisant DCT (discrete cosinus transform : Fourier)&lt;br /&gt;
** ajout d'un curseur &amp;quot;Detail threshold luminance Chroma (DCT)&amp;quot; qui permet de différencier l'action en fonction des bords (&amp;quot;edge detection&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
 [[File:denoise1.jpg|600px|thumb|center|Denoise réglages]]&lt;br /&gt;
&lt;br /&gt;
=====Un cas complexe &amp;quot;Denoise&amp;quot; - comment différentier l'action sur les structures et les aplats=====&lt;br /&gt;
Ce cas, habituel en photographie, consiste à isoler un sujet sur un fond. Le sujet pouvant être un animal, une plante, une personne,... Le fond peut être le ciel, une pelouse, une forêt, un mur...&lt;br /&gt;
Le problème à traiter par les logiciels de dé-bruitage est complexe, car l'algorithme le plus souvent &amp;quot;ignore&amp;quot; la différence &amp;quot;sujet&amp;quot;, &amp;quot;fond&amp;quot; et aboutit si on souhaite supprimer le bruit sur le &amp;quot;fond&amp;quot; à perdre toute les reliefs, contrastes et couleurs du &amp;quot;sujet&amp;quot;&lt;br /&gt;
&lt;br /&gt;
======Un exemple le &amp;quot;mulot&amp;quot;======&lt;br /&gt;
J'ai choisi cette image, avec l'accord de son auteur Andy Astbury, car d'une part elle est excellente, l'animal se détache très bien sur un fond d'apparence gris, et d'autre part elle est bruitée (légèrement). Si on souhaite retirer le bruit sur le fond, avec &amp;quot;Noise reduction&amp;quot; (main), le &amp;quot;mulot&amp;quot; perd contraste et saturation et détails.&lt;br /&gt;
&lt;br /&gt;
Fichier raw :(Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Fichier pp3 [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing&lt;br /&gt;
Le fichier pp3 ne donne pas &amp;quot;le bon réglage&amp;quot; mais garde la trace de réglages de certains outils pour faciliter la découverte des méthodes et outils.&lt;br /&gt;
&lt;br /&gt;
Traditionnellement dans Rawtherapee, on utilise pour retirer le bruit, le module &amp;quot;Noise reduction&amp;quot; (onglet détail). Si on a pour objectif de rendre l'arrière plan sans bruit de luminance et de chrominance - je ne montre pas l'image ni les réglages - on aboutit a des réglages de l'ordre de:&lt;br /&gt;
* curseur luminance = 65&lt;br /&gt;
* curseur chrominance - Master = 20&lt;br /&gt;
Certes le fond d'image sera parfait, mais notre gentil &amp;quot;mulot&amp;quot; va devenir terne, lavé... Alors comment faire ?&lt;br /&gt;
&lt;br /&gt;
Principe de la démarche:&lt;br /&gt;
* traiter le bruit en 2 étapes - une première ''a minima'' utilisant &amp;quot;noise reduction&amp;quot; va permettre de traiter le bruit sur le sujet qu'on souhaite préserver (ici le &amp;quot;mulot&amp;quot;); dans le cas présent l'œil du &amp;quot;mulot&amp;quot; sera discriminant, ainsi également par exemple que la queue. A noter que dans d'autres images cette étape pourra permettre aussi de réduire les gros paquets de bruit.&lt;br /&gt;
* mais le bruit s'apparente aux principes des modèles d'apparence colorée; il sera nettement plus visible sur un fond gris que sur un fond plus sombre (notamment le bruit de chrominance), il en est de même pour les parties lumineuses. On a donc intérêt à coupler dans la même démarche un ajustement des tons de l'image - qui peut également la rendre plus attractive - et le dé-bruitage.&lt;br /&gt;
* ensuite, en deuxième étape,  nous traiterons le bruit avec &amp;quot;Local adjustments&amp;quot;, en utilisant les capacités de cet outil, notamment, les 5 méthodes ci-dessous:&lt;br /&gt;
# le masque qui va permettre de différencier l'action entre les reliefs (&amp;quot;mulot&amp;quot;, &amp;quot;végétation&amp;quot;...) et le &amp;quot;fond&amp;quot;.&lt;br /&gt;
# l'égalisateur Hue qui va permettre de différencier l'action entre la couleur du &amp;quot;mulot&amp;quot; et le &amp;quot;fond&amp;quot;&lt;br /&gt;
# le curseur Scope (deltaE)  qui permet de différencier l'action selon les différences de couleurs&lt;br /&gt;
# les curseurs &amp;quot;luminance detail recovery (DCT) - et dans &amp;quot;edge detection&amp;quot; - luminance et chroma detail theshold, qui agissent par un traitement du bruit (Fourier) basé sur le bruit résultant de l'écart entre l'image originale et celle débruitée par les wavelets.&lt;br /&gt;
# le débruitage par morceaux - encore appelé &amp;quot;Non local Means&amp;quot;, un autre algorithme de débruitage, fondé sur la similarité de pixels et de patch - va lui aussi permettre de différencier l'action entre les reliefs (&amp;quot;mulot&amp;quot;, &amp;quot;végétation&amp;quot;...) et le &amp;quot;fond&amp;quot;.&lt;br /&gt;
* puis nous ferons des ajustements terminaux pour obtenir l'image souhaitée - saturation, contraste local, etc.&lt;br /&gt;
* bien sûr ce document est à titre pédagogique, les réglages sont arbitraires plus tournés vers l'exemple que la recherche d'une belle image.&lt;br /&gt;
&lt;br /&gt;
======Premier &amp;quot;denoise&amp;quot; et &amp;quot;égalisateur de tons&amp;quot;======&lt;br /&gt;
Sur cette image apparaît seulement l'égalisateur de tons.&lt;br /&gt;
On agira en même temps sur &amp;quot;Noise reduction&amp;quot; - luminance et chrominance.&lt;br /&gt;
&lt;br /&gt;
On positionnera des &amp;quot;lockable color pickers&amp;quot; sur l'œil, la fourrure, la végétation, la queue.&lt;br /&gt;
&lt;br /&gt;
* ajouter un nouveau &amp;quot;RT spot&amp;quot; - choisir dans settings &amp;quot;Full image&amp;quot;. Toujours dans settings aller à &amp;quot;Mask and merge&amp;quot; et régler &amp;quot;background color for luminance and color masks&amp;quot; à 0 (ceci va permettre un meilleur suivi des valeurs de la luminance)&lt;br /&gt;
* Add tool to current spot..: choisir &amp;quot;shadows/highlight and Tone equalizer&amp;quot; - Basic&lt;br /&gt;
* positionner le centre du &amp;quot;RT-spot&amp;quot; sur le &amp;quot;fond&amp;quot;&lt;br /&gt;
* agir sur les curseurs de l'égalisateur pour obtenir le meilleur compromis, tout en agissant sur les 2 curseurs de &amp;quot;Noise reduction&amp;quot; - ici j'ai utilisé - Luminance = 4 - chrominance = 6.5&lt;br /&gt;
&lt;br /&gt;
 [[File:mulot_first.jpg|600px|thumb|center|Noise reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Deuxième étape - Local adjustments - Blur/grain &amp;amp; Denoise module======&lt;br /&gt;
* Add tool to current spot... Sélectionnez &amp;quot;Blur/grain &amp;amp; Denoise&amp;quot;, puis &amp;quot;Denoise&amp;quot;, &amp;quot;Avancé&amp;quot;&lt;br /&gt;
* Utiliser la courbe &amp;quot;Luminance detail by level&amp;quot;&lt;br /&gt;
* à titre pédagogique et afin de voir l'efficacité des divers outils vous pouvez mettre cette courbe au maximum et activer &amp;quot;agressive&amp;quot;...bien sûr il faudra ensuite la ramener à des valeurs normales.&lt;br /&gt;
&lt;br /&gt;
Puis, je recommande, toujours à titre pédagogique d'essayer une par une, les 5 méthodes citées plus haut. Par exemple pour voir l'action de l'égalisateur Hue, mettre Scope à 100, mettre le curseur &amp;quot;Recovery threshold à 1&amp;quot; dans &amp;quot;Recovery based on luminance mask&amp;quot; pour le désactiver, laisser les 3 curseurs DCT à leurs valeurs par défaut. &lt;br /&gt;
* régler le Equalizer hue en renforçant le débruitage pour le &amp;quot;fond&amp;quot; et en l'atténuant pour le &amp;quot;mulot&amp;quot;&lt;br /&gt;
* agir légèrement sur &amp;quot;Fine chroma&amp;quot;&lt;br /&gt;
* examinez les résultats&lt;br /&gt;
 [[File:mulot_levelhue.jpg|600px|thumb|center|Denoise by levels - equalizer hue]]&lt;br /&gt;
&lt;br /&gt;
* Réaliser un masque.&lt;br /&gt;
** Ce masque va permettre ensuite avec un des outils de &amp;quot;Local adjustments - denoise&amp;quot;, de discriminer l'action entre le &amp;quot;fond&amp;quot; et le reste de l'image &amp;quot;mulot&amp;quot; et végétation.&lt;br /&gt;
**Dans le cas présent je me suis servi d'une simple courbe L(L), du gamma et de la courbe de contraste , mais d'autres images pourraient nécessiter d'utiliser la courbe LC(H), structure mask strength, Smooth radius, etc.&lt;br /&gt;
 [[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
Courbe de contraste:&lt;br /&gt;
 [[File:mulot_mask2.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
Ensuite:&lt;br /&gt;
* activez le masque (mask and modifications)&lt;br /&gt;
* ouvrez l'expander &amp;quot;Recovery based on luminance mask&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Recover threshold&amp;quot;, des détails vont réapparaître...&lt;br /&gt;
&lt;br /&gt;
Pour d'autres images il sera peut être nécessaire d'agir sur :&lt;br /&gt;
*  &amp;quot;Dark area luminance threshold&amp;quot;, valeurs en-dessous de laquelle la luminance du masque sera prise en compte pour accroître le dé-bruitage - la référence du noir étant celle du masque&lt;br /&gt;
*  &amp;quot;Light area luminance threshold&amp;quot;, valeurs au-dessus de laquelle la luminance du masque sera prise en compte pour accroître le dé-bruitage de manière régressive - la référence du blanc étant celle du masque si elle existe correspondra au dé-bruitage maximum- de cette référence jusqu'au blanc maximum qui si il est à 100 n'aura pas de dé-bruitage. Cette action va ici permettre par exemple de &amp;quot;dé-bruiter&amp;quot; ou non les parties claires de la végétation.&lt;br /&gt;
* decay permet de gérer la progressivité des changements&lt;br /&gt;
* les 2 curseurs &amp;quot;Gray area&amp;quot; permettent si nécessaire de réintroduire un débruitage dans la zone &amp;quot;protégée&amp;quot; - tons moyens du masque&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Utilisation de Scope : ici nous sommes en terrain connu. Vous pouvez utiliser dans &amp;quot;Mask and modifications&amp;quot; les 2 sélections &amp;quot;Show modified areas with mask&amp;quot;  et &amp;quot;Show modified areas whithout mask&amp;quot; pour voir l'incidence de Scope...Ou plus simplement agir sur Scope et voir l'effet. Sur cette image, avec &amp;quot;Equalizer hue&amp;quot; désactivé et &amp;quot;Recovery based on luminance mask&amp;quot; à 0, l'action de Scope est sensible entre 50 et 100.&lt;br /&gt;
* Utilisation des 2 curseurs &amp;quot;Luminance detail recovery&amp;quot; et &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot;&lt;br /&gt;
** accroissez progressivement &amp;quot;Luminance detail recovery&amp;quot; &lt;br /&gt;
** agissez en parallèle sur le &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot;... vous verrez réapparaître des détails.&lt;br /&gt;
** 2 algorihmes sont possibles - le premier utilise un masque interne - le second un Laplacien. Chacun a ses particularités, le Laplacien est plus sélectif, mais moins progressif&lt;br /&gt;
&lt;br /&gt;
* Utiliser &amp;quot;Débruitage par morceaux (patch)&amp;quot; (Non-local means)&lt;br /&gt;
** Débruitage par morceaux - c'est quoi ? Contrairement aux filtres habituels qui réalisent une moyenne des valeurs du groupe de pixels localisés autour d'un pixel cible afin de réduire le bruit, le filtre &amp;quot;non-local means&amp;quot; réalise une moyenne de la totalité des valeurs des pixels contenus dans l'image, pondérées en fonction de leur similarité avec le pixel cible. Le résultat d'un tel filtrage permet d’amoindrir la perte de détails au sein de l'image, comparé aux filtres réalisant des moyennes localement.&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Débruitage par morceaux]]&lt;br /&gt;
&lt;br /&gt;
Afin de bien percevoir les effets de cette méthode, je recommande toujours à titre pédagogique:&lt;br /&gt;
* activer en méthode de débruitage - mode : &amp;quot;Non-local means only&amp;quot;&lt;br /&gt;
* désactivez le masque&lt;br /&gt;
* mettez Scope à 100&lt;br /&gt;
&lt;br /&gt;
En mode &amp;quot;avancé&amp;quot; vous disposez de 5 curseurs:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery - permet une première sélection entre les aplats et les textures. Plus les valeurs sont élévées plus les détails réapparaissent&lt;br /&gt;
* Gamma - seconde sélection entre les aplats et les textures. Plus le gamma sera faible plus les détails et les textures seront reconstituées&lt;br /&gt;
* Maximum patch size : permet d'adapter la taille du &amp;quot;patch&amp;quot; (morceaux) à la taille des objets. En théorie, plus l'image est bruitée plus cette valeur doit être grande. En pratique c'est par l'observation et la minimisation des artefacts dans les transitions - aplats / textures - que l'on sera guidé&lt;br /&gt;
* Maximum radius size : plus cette valeur sera grande, meilleure sera théoriquement le débruitage, mais en conséquence les temps de traitement vont considérablement s'accroître.&lt;br /&gt;
 &lt;br /&gt;
======Ajustement final - Saturation et Contraste local======&lt;br /&gt;
Ajoutez un nouveau RT-spot, centré sur le &amp;quot;mulot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Puis ajoutez 2 outils:&lt;br /&gt;
* add tool to current spot - &amp;quot;Vibrance and warm cool&amp;quot; - basic&lt;br /&gt;
** agissez sur le curseur &amp;quot;vibrance&amp;quot; jusqu'à obtenir l'accroissement souhaité de saturation&lt;br /&gt;
&lt;br /&gt;
* add tool to current spot - &amp;quot;Local contrast &amp;amp; Wavelet&amp;quot; - Wavelet - Advanced&lt;br /&gt;
** utilisez &amp;quot;contrast by level&amp;quot; en privilégiant les premiers niveaux&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Autres méthodes et outils======&lt;br /&gt;
D'autres méthodes peuvent être utilisées avec la même finalité:&lt;br /&gt;
* méthodes de &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot; - se sert du même masque que &amp;quot;Recovery based on luminance mask&amp;quot; mais renforce ou affaibli le débruitage &amp;quot;wavelet&amp;quot; - il agit à la manière de &amp;quot;l'equalizer hue&amp;quot; - &amp;quot;avant&amp;quot;, alors que &amp;quot;Recovery based on luminance mask&amp;quot; agit &amp;quot;après&amp;quot; en comparant l'image originale bruitée et l'image débruitée.&lt;br /&gt;
**  &amp;quot;equalizer white-black&amp;quot; et &amp;quot;equalizer blue-yellow red-green&amp;quot; : ils sont l'équivalent de la courbe &amp;quot;luminance curve&amp;quot; dans &amp;quot;Noise reduction&amp;quot; et peu efficaces ici&lt;br /&gt;
** &amp;quot;Guided Filter&amp;quot; dans &amp;quot;Blur/grain &amp;amp; denoise&amp;quot; - &amp;quot;Blur &amp;amp; Noise&amp;quot; : vous utilisez le même masque et le même processus &amp;quot;Recovery based on luminance mask&amp;quot; en utilisant les valeurs négatives du curseur &amp;quot;détail&amp;quot;&lt;br /&gt;
** &amp;quot;Excluding spots&amp;quot; - qui permettent de restaurer l'image avant l'action du RT-spot &amp;quot;Full image&amp;quot;&lt;br /&gt;
** &amp;quot;Median&amp;quot; dans &amp;quot;Flouter/grain &amp;amp; Dé-bruiter&amp;quot; &amp;gt; &amp;quot;Flouter &amp;amp; Brui&amp;quot;: peu efficace ici.&lt;br /&gt;
** &amp;quot;Netteté des bords&amp;quot; dans &amp;quot;Contrast local &amp;amp; Ondelettes&amp;quot; &amp;gt; &amp;quot;Ondelettes&amp;quot; &amp;gt; &amp;quot;Pyramide 1&amp;quot;: si vous voulez flouter une partie de l'image en fonction du niveau de détail.  &lt;br /&gt;
&lt;br /&gt;
* autres méthodes de Rawtherapee (non développées ici)&lt;br /&gt;
** &amp;quot;Noise reduction&amp;quot; : les courbes &amp;quot;Luminance control&amp;quot; et chromiannce curve permetent une certaine forme de sélection, mais insuffisante ici.&lt;br /&gt;
** &amp;quot;Wavelet levels - noise reduction&amp;quot; - avec notamment un &amp;quot;equalizer hue&amp;quot; et l'utilisation de &amp;quot;Local contrast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Comparaison des outils denoise&lt;br /&gt;
[[Denoise/fr|Comparaison des 3 outils « Denoise » de Rawtherapee]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Synthèse======&lt;br /&gt;
Cet exemple, merci encore à Andy Astbury pour cette excellente image, qui permet de déployer à titre pédagogique 5 méthodes pour différencier l'action entre structures et aplats.&lt;br /&gt;
* &amp;quot;Equalizer hue&amp;quot;&lt;br /&gt;
* &amp;quot;Recovery based on luminance mask&amp;quot;&lt;br /&gt;
* &amp;quot;Scope&amp;quot; - deltaE&lt;br /&gt;
* &amp;quot;DCT - Edge detection&amp;quot;&lt;br /&gt;
* &amp;quot;Non-local means&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Dans une image difficile il sera probablement nécessaire d'activer les 5 méthodes avec un équilibre toujours difficile à trouver. Le résultat étant affaire de goût de chacun et est assez subjectif. &lt;br /&gt;
&lt;br /&gt;
Notamment:&lt;br /&gt;
* le &amp;quot;fond&amp;quot; qui ici est uniforme, pourra poser plus de problèmes si il y a du relief, des structures.&lt;br /&gt;
* les couleurs qui ici sont bien séparées, ne vont pas permettre une telle séparation si elles sont plus &amp;quot;mélangées&amp;quot;&lt;br /&gt;
* le deltaE qui peut être très perturbé par le bruit chromatique, avec en plus la même remarque que ci-dessus&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; qui lui aussi sera perturbé par un bruit de luminance important&lt;br /&gt;
&lt;br /&gt;
====Un moment de folie - utiliser wavelet====&lt;br /&gt;
&lt;br /&gt;
A voir dans : Quelques particularités du mode local (par rapport à Lab adjustements) [[Local Lab controls/fr#Wavelets Pyramid (détails)| Wavelets]]&lt;br /&gt;
=====A titre de démonstration....(ne fuyez pas... ce n'est pas si complexe que cela)=====&lt;br /&gt;
Image originale, avec &amp;quot;Exposure compensation&amp;quot; +1.5&lt;br /&gt;
 [[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
&lt;br /&gt;
=====La même image avec &amp;quot;Levels Dynamic Range (un)Compression (wavelet local) &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot;=====&lt;br /&gt;
* Tous les réglages par défaut (settings)&lt;br /&gt;
* Outil &amp;quot;wavelet pyramid2&amp;quot; activé (advanced)&lt;br /&gt;
* scope (wavelet) réglé sur 80&lt;br /&gt;
* puis les réglages visibles sur la capture d'écran&lt;br /&gt;
* bien sûr l'apparence est subjective, chacun peut accentuer ou réduire les réglage, en ajouter,....&lt;br /&gt;
* cette version de &amp;quot;Tone mapping&amp;quot; est différente des autres algorithmes implantés dans Rawtherapee (Fattal &amp;quot;dynamic range compression&amp;quot;, Mantiuk &amp;quot;Tone mapping&amp;quot;, Log Encoding), elle est spécifique à Rawtherapee Wavelet.  &lt;br /&gt;
 [[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam Wavelet Tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Trois manières d'accroître la texture====&lt;br /&gt;
Toujours à titre de démonstration, 3 manières d’accroître la texture. Ceci est obtenu par des principes de Tone-mapping&lt;br /&gt;
J'utiliserais :&lt;br /&gt;
* tone-mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelet&lt;br /&gt;
=====Préparation - image originale - Venise=====&lt;br /&gt;
 [[File:texture-normal1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Copyright Sebastien Guyader -  Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Traitement &amp;quot;Tone mapping&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Voir dans :Quelques particularités du mode local (par rapport à Lab adjustements) [[Local Lab controls/fr#Tone Mapping| Avec Tone mapping]]&lt;br /&gt;
* remarquez l'utilisation de &amp;quot;normalize luminance&amp;quot; qui maintient à l'image la même moyenne et la même variance que l'image originale&lt;br /&gt;
* utilisation du mode &amp;quot;advanced&amp;quot; - &amp;quot;edge stopping&amp;quot; et &amp;quot;scale'&lt;br /&gt;
  [[File:texture-tm1.jpg|600px|thumb|center|Tone mapping 'mantiuk']]&lt;br /&gt;
&lt;br /&gt;
=====Traitement &amp;quot;Retinex&amp;quot;=====&lt;br /&gt;
Voir dans : Quelques particularités du mode local (par rapport à Lab adjustements) [[Local Lab controls/fr#Dehaze &amp;amp; Retinex| Avec Retinex]]&lt;br /&gt;
&lt;br /&gt;
* remarquez l'utilisation de &amp;quot;Normalize luminance&amp;quot;  qui maintient à l'image la même moyenne et la même variance que l'image originale&lt;br /&gt;
* l'usage de &amp;quot;Fast Fourier Transform&amp;quot;&lt;br /&gt;
  [[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Traitement &amp;quot;Wavelet&amp;quot; (Local contrast &amp;amp; wavelets)=====&lt;br /&gt;
Voir dans : Quelques particularités du mode local (par rapport à Lab adjustements) : [[Local Lab controls/fr#Wavelet level tone mapping| Avec Wavelets]]&lt;br /&gt;
&lt;br /&gt;
* remarquez l'usage de &amp;quot;Levels dynamic range compression&amp;quot;, les valeurs de &amp;quot;Attenuation Response&amp;quot;, &amp;quot;balance threshold&amp;quot; et &amp;quot;compress residual image&amp;quot;&lt;br /&gt;
* essayez aussi &amp;quot;Contrast by levels&amp;quot;&lt;br /&gt;
* essayez aussi &amp;quot;Levels directionnal contrast&amp;quot;&lt;br /&gt;
* ou une combinaison de ces traitements&lt;br /&gt;
  [[File:texture-wav1.jpg|600px|thumb|center|Wavelet TM]]&lt;br /&gt;
&lt;br /&gt;
====Fusion d'images - modes de fusion (merge file)====&lt;br /&gt;
Voir dans Principes généraux : [[Local Lab controls/fr#Algorithme complémentaire : fusion d'images| Fusion d'images]]&lt;br /&gt;
&lt;br /&gt;
Vous pouvez utiliser dans &amp;quot;Color &amp;amp; light&amp;quot; - &amp;quot;Merge file&amp;quot; qui va vous permettre de simuler la fusion de calques.&lt;br /&gt;
En effet chaque RT-spot correspond (ce n'est qu'une similitude) à un calque. Le système proposé permet de gérer jusqu'à une prise en compte de 2 RT-Spot et l'image d'origine.&lt;br /&gt;
* Le premier &amp;quot;calque&amp;quot; est appelé &amp;quot;Original&amp;quot;, il correspond (comme &amp;quot;Excluding spot&amp;quot;) aux données avant toute intervention &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
* si vous empilez des RT-spots l'un au dessus de l'autre, par exemple 6:&lt;br /&gt;
** &amp;quot;Merge file&amp;quot; fusionnera le 6ème (calque) si le Spot courant est le 6, soit avec le 5ème (Previous Spot), soit avec &amp;quot;Original&amp;quot; (les données d'origine), soit avec une couleur définie dans &amp;quot;background&amp;quot;&lt;br /&gt;
** &amp;quot;Merge file&amp;quot; fusionnera le spot courant (par exemple le 3 sur les 6 en cours) avec le 2ème (Previous spot), soit avec &amp;quot;Original&amp;quot; (les données d'origine), soit avec une couleur définie dans &amp;quot;background&amp;quot;&lt;br /&gt;
** pour chacune de ces fusions vous disposez de 21 modes de fusions inspirés de ceux de Photoshop (C) (Normal, differences, ....soft light,..., overlay,...)&lt;br /&gt;
** pour chacun vous pouvez gérer l'opacité, la prise en compte du deltaE, et un &amp;quot;contrast threshold&amp;quot; (à l'exception du choix &amp;quot;background&amp;quot;)&lt;br /&gt;
** les &amp;quot;Graduated Filter&amp;quot; (Luminance, Chrominance, Hue) - situés dans &amp;quot;Color and Light&amp;quot; - fonctionnent avec &amp;quot;merge files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* A titre d'exemple je vais utiliser ces fonctionnalités pour gérer un flou variable (bien sûr vous pouvez faire autre chose)&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
Je passe sur les premières étapes qui sont similaires.&lt;br /&gt;
Dans ce cas, je choisis &amp;quot;add tool to current spot&amp;quot; =  &amp;quot;Smooth - Blur - denoise&amp;quot;&lt;br /&gt;
* régler le RT-spot en inverse&lt;br /&gt;
* choisir Scope = 90 ou 100 selon l'effet recherché&lt;br /&gt;
* régler radius sur une valeur élevée (2000 ou plus - noter l'option FFTW), régler le mode de flou sur &amp;quot;Luminance &amp;amp; chrominance&amp;quot;&lt;br /&gt;
   [[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Créer un deuxième RT-spot=====&lt;br /&gt;
Avec &amp;quot;Add tool to current spot&amp;quot; - &amp;quot;Color &amp;amp; light&amp;quot; - &amp;quot;advanced&amp;quot;&lt;br /&gt;
* réglez &amp;quot;Scope color tools&amp;quot; sur 100&lt;br /&gt;
   [[File:mergetwo1.jpg|600px|thumb|center|Deuxième spot]]&lt;br /&gt;
&lt;br /&gt;
=====Première fusion - mode de fusion &amp;quot;normal&amp;quot;=====&lt;br /&gt;
* Allez jusque l'expander &amp;quot;merge file&amp;quot;&lt;br /&gt;
* choisissez dans la liste &amp;quot;Original&amp;quot; - les autres choix :&lt;br /&gt;
** &amp;quot;Previous spot&amp;quot; permet la fusion avec le RT-spot précédent (identique à Original - si il n'y a que 1 RT-spot)&lt;br /&gt;
** &amp;quot;Background&amp;quot; permet la fusion avec un fond coloré;&lt;br /&gt;
&lt;br /&gt;
* choisissez ensuite dans &amp;quot;Merge with Original or Previous or Background&amp;quot; le mode de fusion et choisissez les réglages : Merge background, Opacity, contrast threshold&lt;br /&gt;
* bien sûr vous pouvez utiliser tous les réglages possibles de &amp;quot;Color &amp;amp; Light&amp;quot; &lt;br /&gt;
    [[File:mergeorignrmal1.jpg|600px|thumb|center|Fusion &amp;quot;normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Deuxième mode de fusion  - Soft light=====&lt;br /&gt;
Dans la liste des modes de fusion essayez &amp;quot;Soft light (legacy)&amp;quot; (ou un autre mode...)&lt;br /&gt;
* choisissez les réglages, essayez...&lt;br /&gt;
* remplacez &amp;quot;Original&amp;quot; par &amp;quot;Previous Spot&amp;quot;...notez les différences&lt;br /&gt;
   [[File:mergeorigsoftlight1.jpg|600px|thumb|center|Fusion &amp;quot;normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Utilisation d'un masque simple pour accroître la sélection de couleur====&lt;br /&gt;
Voir dans &amp;quot;Principes généraux&amp;quot;: [[Local Lab controls/fr#Algorithme complémentaire - Mask and Modifications| Utilisation d'un masque simple]]&lt;br /&gt;
&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* J'ai choisi l'image de la montagne de sel à Pammukale (Turquie).&lt;br /&gt;
* C'est une image difficile à traiter, du fait des faibles différences de couleurs entre le ciel et la montagne. De plus cette montagne contient de nombreuses irrégularités.&lt;br /&gt;
* Je passe sur les étapes préliminaires similaires aux cas précédents. Notez le réglage de &amp;quot;Scope color tools = 40&amp;quot; qui est un compromis pour permettre de traiter correctement la montagne&lt;br /&gt;
* Je propose à titre pédagogique d'accroître de manière très forte la luminance (lightness) et la chrominance de la montagne (ce n'est pas un objectif artistique) : l'objectif est si possible que cette modification ne touche pas le ciel&lt;br /&gt;
* j'aurais pu utiliser des &amp;quot;excluding spot&amp;quot;, ou si le GUI le prévoit un jour, une délimitation par un polygone; mais à titre pédagogique j'utilise un masque simple. J'aurais pu utiliser plusieurs courbes pour le masque, ou plusieurs masques (dupliquer le RT-spot).&lt;br /&gt;
* &amp;quot;Local adjustments&amp;quot; permet la gestion de 2 types de masques:&lt;br /&gt;
** 1) ceux qui n'ajoutent ou ne retranchent pas le masque à l'image. On vise l'amélioration de la qualité de la sélection deltaE&lt;br /&gt;
** 2) ceux qui utilisent ces différences&lt;br /&gt;
** nous sommes ici dans le premier cas (amélioration de la sélection)&lt;br /&gt;
  [[File:masksimpleprepa1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Accroître fortement lightness et la chrominance=====&lt;br /&gt;
* Constatez le résultat : les couleurs bavent, le ciel est touché par les changements, alors que je souhaite l'éviter&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Accroissement de lightness et de la chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Élaborer un masque simple=====&lt;br /&gt;
* j'ai pris le parti de ne me servir que de une des 3 courbes LCH (ici L)&lt;br /&gt;
* examinez le positionnement de la courbe L(L) : le point d'inflexion est situé à la transition entre zones grises. Pour toutes les courbes - C(C), L(L), LC(H), cette &amp;quot;transition&amp;quot; correspond aux 3 références du RT-spot (chroma, luma, hue)&lt;br /&gt;
* ne pas utiliser &amp;quot;blend&amp;quot; : donc il n'y a que la détection de forme qui est améliorée&lt;br /&gt;
* vous pouvez utiliser aussi dans &amp;quot;Mask and modifications&amp;quot; - &amp;quot;Show modifications with mask&amp;quot;&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Affiche le masque]]&lt;br /&gt;
&lt;br /&gt;
=====Finaliser le résultat=====&lt;br /&gt;
* mettez &amp;quot;mask and modifications&amp;quot; sur &amp;quot;none&amp;quot;&lt;br /&gt;
* activez &amp;quot;enable mask&amp;quot;&lt;br /&gt;
* agissez si nécessaire sur &amp;quot;Smooth radius mask&amp;quot;&lt;br /&gt;
* retouchez éventuellement les courbes &amp;quot;Contrast curve&amp;quot; et L(L)&lt;br /&gt;
* passez en mode &amp;quot;advanced&amp;quot; et essayez &amp;quot;Gamma&amp;quot;, &amp;quot;Slope&amp;quot;, ainsi que &amp;quot;Laplacian thresholdk&amp;quot; (à la place de &amp;quot;Smooth radius&amp;quot;)&lt;br /&gt;
* certes ce n'est pas parfait, mais nettement mieux....l'objectif est la découverte du fonctionnement des masques.&lt;br /&gt;
&lt;br /&gt;
Pour améliorer le traitement de type masque, 2 solutions s'offrent à vous :&lt;br /&gt;
* Dupliquer le RT-spot : si vous dupliquez le RT-spot, à côté du précédent, en changeant légèrement la position du centre (références), vous pouvez utiliser un second masque pour retoucher les &amp;quot;anomalies - incomplétudes&amp;quot; du précédent. De plus cette option permet de retoucher si nécessaire la valeur des traitements (ici lightness, chrominance) et la &amp;quot;partager&amp;quot; entre les 2 RT-spot pour une meilleure homogénéité.&lt;br /&gt;
* Utiliser le masque d'un autre outil ouvert (si bien sûr celui-ci est doté d'un masque). Dans ce cas vous conservez les mêmes références (luma, chroma, hue) aussi bien pour élaborer les masques que pour la prise en compte du deltaE (scope)&lt;br /&gt;
&lt;br /&gt;
Prise en compte des deltaE:&lt;br /&gt;
* vous pouvez désactiver la fonction cœur de &amp;quot;Local adjustments&amp;quot; - c'est à dire la fonction &amp;quot;Scope&amp;quot; qui prend en compte le deltaE - si vous souhaitez travailler entièrement avec les masques et ignorer &amp;quot;Scope&amp;quot;, dans ce cas réglez &amp;quot;Scope=100&amp;quot;. A l'évidence la fonctionnalité &amp;quot;Scope&amp;quot; étant désactivée, seule l'utilisation de &amp;quot;blend&amp;quot; sera opérationnelle pour assurer la combinaison masque / image.&lt;br /&gt;
* Lorsque vous utilisez les outils des masques &amp;quot;Tools&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), ceux-ci sont sensibles au réglage spécifique du deltaE masque : &amp;quot;Mask deltaE image&amp;quot; (&amp;quot;settings&amp;quot;)&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Résultat]]&lt;br /&gt;
&lt;br /&gt;
=====Amélioration du résultat avec 'Recovery based on luminance mask'=====&lt;br /&gt;
Nous allons élaborer un masque qui sera utilisé d'une manière différente des autres processus dans RT. Ce masque sera utilisé &amp;quot;en direct&amp;quot; et son analyse va servir à combiner l'image sans l'action de &amp;quot;Color and Light&amp;quot;, avec l'image traitée avec &amp;quot;Color and light&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* régler l'arrière plan des masques afin que la lecture des valeurs L*a*b* des &amp;quot;Lockable Color pickers&amp;quot; correspondent aux valeurs réelles : dans &amp;quot;Local adjustments&amp;quot; - &amp;quot;Settings&amp;quot; -&amp;quot;Mask and merge&amp;quot; - &amp;quot;Background color for luminance and color masks = 0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Selon les réglages de &amp;quot;Recovery based on luminance mask&amp;quot;:&lt;br /&gt;
* les zones sombres et noires du masque donneront la possibilité de ramener l'image combinée au plus près de l'image originale.&lt;br /&gt;
* les zones très claires ou blanches du masque donneront la possibilité de ramener l'image combinée au plus près de l'image originale.&lt;br /&gt;
* la zone intermédaire conservera les réglages de &amp;quot;Color and Light&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Image avec réglages &amp;quot;Color &amp;amp; Light&amp;quot; - sans masque&lt;br /&gt;
&lt;br /&gt;
Fichier pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Création du masque======&lt;br /&gt;
Notez l'utilisation de &amp;quot;Blur mask&amp;quot; avec 'Contrast threshold' et 'Radius'. Cette action permet de relever la valeur des gris dans la partie droite de la montagne de sel pour permettre une action 'légère' de Color and Light'&lt;br /&gt;
Remarque : l'utilisation 'avancée' de ce masque avec 'Recovery' n'esr pas en opposition avec l'utilisation 'normale' du masque : &lt;br /&gt;
* l'utilisation 'normale' va améliorer la sélection&lt;br /&gt;
* l'utilisation 'avancée avec recovery' va à nouveau améliorer la sélection.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Récupération des caractéristiques de l'image d'origine======&lt;br /&gt;
* Assurez vous que le masque est activé dans &amp;quot;Masque et modifications&amp;quot;: case &amp;quot;Enable mask&amp;quot; cochée.&lt;br /&gt;
* dépliez l'expander &amp;quot;Recovery based on luminance mask&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Recovery threshold&amp;quot; : plus le curseur sera proche de &amp;quot;2&amp;quot;, plus les zones sombres et très claires du masque seront prises en compte, plus ces zones seront ramenées aux valeurs de l'image originale&lt;br /&gt;
* agissez sur les curseurs &amp;quot;Dark area luminance threshold&amp;quot; et &amp;quot;Light area luminance threshold&amp;quot; pour inclure ou exclure certaines parties de l'image. Les valeurs correspondantes (ici dark = 32.1 et Light = 85) sont les 2 limites en deçà et au delà desquelles les actions du masque seront progressivement prises en compte.&lt;br /&gt;
* agissez éventuellement sur &amp;quot;decay&amp;quot; pour régler la &amp;quot;vitesse&amp;quot; de la décroissance.&lt;br /&gt;
* essayez dans &amp;quot;Masque et modifications&amp;quot; de désactiver le masque : case &amp;quot;Enable mask&amp;quot; décochée.&lt;br /&gt;
* essayez dans &amp;quot;Masque et modifications&amp;quot;avec masque activé - case &amp;quot;Enable mask&amp;quot; cochée - de remettre à 1 le curseur 'Recovery threshold'&lt;br /&gt;
* essayez d'autres réglages de &amp;quot;mask&amp;quot; et des 4 réglages de &amp;quot;recovery&amp;quot;&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Que faire quand un masque présente une apparence poivre et sel ?====&lt;br /&gt;
Lorsque vous utilisez lors de la création du masque, la courbe LC(h), l'image du masque peut être perturbée par une multitude de points noirs et blancs (poivre et sel) qui détournent le masque de son usage. L'image originale choisie ne convient pas car elle est peu bruitée j'en ai choisie une autre qui présente la caractéristique d'un bruit chromatique assez important.&lt;br /&gt;
&lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Comment le traiter?=====&lt;br /&gt;
Vous trouverez dans &amp;quot;Settings&amp;quot; &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, un curseur &amp;quot;Denoise chroma mask&amp;quot;.&lt;br /&gt;
* agissez jusqu'à obtenir l'effet désiré&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Le bruit chromatique peut avoir d'autres incidences sur l'utilisation des masques=====&lt;br /&gt;
Si vous souhaitez utiliser pour l'élaboration du masque la courbe C:, lors de la fusion du masque avec l'image originale des artefacts (paquets) de tâches grisâtres peuvent apparaître. Dans ce cas c'est probablement le bruit chromatique qui est en cause. Procédez comme précédemment.&lt;br /&gt;
&lt;br /&gt;
====Utilisation d'un masque avec mélange (blend) du masque et de l'image====&lt;br /&gt;
Je souhaite ici accroître l'impression de perspective (relief) des Pagodes...&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
* j'aurais pu ici utiliser des outils spécifiques pour accroître l'impression de relief, comme CBDL (&amp;quot;contrast by detail levels&amp;quot;) ou Wavelet pyramid (Local contrast &amp;amp; wavelets)&lt;br /&gt;
* mais à titre pédagogique je vais utiliser un masque avec &amp;quot;blend&amp;quot;&lt;br /&gt;
* je ne retrace pas les démarches de démarrage qui sont identiques&lt;br /&gt;
* à retenir : &amp;quot;Scope color&amp;quot; réglée à 40 (arbitraire), et &amp;quot;Color and Light&amp;quot; en mode &amp;quot;advanced&amp;quot;&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Réglages du mask - ce qu'il ne faut pas faire=====&lt;br /&gt;
* A titre pédagogique j'utilise 2 fonctionnalités:&lt;br /&gt;
** Courbe LC(H) pour sélectionner les couleurs&lt;br /&gt;
** &amp;quot;Mask Blur&amp;quot; qui associe un &amp;quot;contrast threshold&amp;quot; et une fonction de floue (blur)&lt;br /&gt;
* A noter la case à cocher &amp;quot;FFTW&amp;quot;, qui certes consomme des ressources, mais accroît les possibilités ainsi que la qualité des résultats : dans le cas sans FFTW le rayon (radius) est limité à 100, avec FFTW celui-ci est porté à 1000.&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|Affiche le masque]]&lt;br /&gt;
&lt;br /&gt;
======Résultats======&lt;br /&gt;
* Là encore, activez le masque &amp;quot;Enable mask&amp;quot;&lt;br /&gt;
* réglez &amp;quot;blend&amp;quot; à votre souhait&lt;br /&gt;
* éventuellement ajustez &amp;quot;Smooth radius mask&amp;quot;&lt;br /&gt;
* si vous avez activé les réglages &amp;quot;non mask&amp;quot; de &amp;quot;Color and light&amp;quot; (lightness, contrast, etc.), le curseur &amp;quot;Structure spot&amp;quot; va avoir une incidence.&lt;br /&gt;
* vous pouvez constater que l'image a maintenant une dominante de couleur... La cause, la courbe LC(H) qui utilise &amp;quot;blend&amp;quot;, donc amène un changement de couleur&lt;br /&gt;
** essayez de passer la courbe en mode &amp;quot;linear&amp;quot;, vous verrez la disparition de la dominante&lt;br /&gt;
** conséquence : évitez de mettre plusieurs réglages masques impliquant ou non &amp;quot;blend&amp;quot;&lt;br /&gt;
** si vous avez besoin de ces 2 réglages, il est souhaitable comme dans le cas vu plus haut &amp;quot;masque simple&amp;quot; soit de créer un deuxième (ou plus) RT-Spot avec &amp;quot;dupliquer&amp;quot;, l'un avec &amp;quot;blend&amp;quot;, l'autre sans (ou avec des valeurs de &amp;quot;blend&amp;quot; différentes), soit d'utiliser un autre masque associé à un autre outils.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====La bonne démarche=====&lt;br /&gt;
Comme vu plus haut, elle consiste à procéder en 2 étapes, par exemple en créant 2 spots&lt;br /&gt;
* le premier pour prendre en compte la courbe LCH..&lt;br /&gt;
* le second qui va agir sur la structure&lt;br /&gt;
&lt;br /&gt;
======Action sur la structure======&lt;br /&gt;
Plusieurs outils de type &amp;quot;mask&amp;quot; (en mode &amp;quot;advanced&amp;quot;) permettent de modifier la structure&lt;br /&gt;
* &amp;quot;Mask Blur&amp;quot; qui associe un &amp;quot;contrast threshold&amp;quot; et une fonction de floue (blur)&lt;br /&gt;
* &amp;quot;Mask structure&amp;quot; qui agit directement sur la structure du &amp;quot;mask&amp;quot;&lt;br /&gt;
* Pour ces deux outils, les courbes LCH peuvent être inactives (pas de courbes); si vous le souhaitez vous pouvez associer la courbe L(L) de LCH;&lt;br /&gt;
* Ces 2 outils &amp;quot;Mask blur&amp;quot; et &amp;quot;Mask Structure&amp;quot; peuvent  être associés&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Mask levels local contrast&amp;quot; et &amp;quot;Mask wavelet levels&amp;quot;, peut être associé à la courbe de création de masque L(L) et générer un &amp;quot;local contrast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rappel:&lt;br /&gt;
* Là encore, activez le masque &amp;quot;Enable mask&amp;quot;&lt;br /&gt;
* réglez &amp;quot;blend&amp;quot; à votre souhait&lt;br /&gt;
* éventuellement ajustez &amp;quot;Smooth radius&amp;quot;&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Résultat]]&lt;br /&gt;
&lt;br /&gt;
====Comment se servir de Common Color Mask - puis Exemple de combinaison avec une fusion de 2 RT-Spot====&lt;br /&gt;
Voir dans Principes généraux [[Local Lab controls/fr#Masque commun couleur | Masque commun couleur]]&lt;br /&gt;
&lt;br /&gt;
Ce masque ne fonctionne pas exactement comme les autres masques de &amp;quot;Local adjustments&amp;quot;. Il ne vient pas en complément d'un outil, comme par exemple le masque dans &amp;quot;Color and light&amp;quot;, mais est un outil en lui même. Vous pouvez vous en servir pour changer l'apparence d'une image - contraste, luminance, couleur....mais aussi texture.&lt;br /&gt;
* cet outil fonctionne en prenant en compte le masque qui vient modifier l'image (en plus ou en moins). L'écart des couleurs entre l'image +- masque et l'image originale est régulée par la prise en compte du deltaE - ΔE - et bien sûr des transitions.&lt;br /&gt;
* bien sûr vous pouvez l'utiliser aussi en association avec d'autres outils dans le même RT-spot ou non&lt;br /&gt;
* l'exemple donné - simple - permet de comprendre le fonctionnement; Il rentre dans la &amp;quot;philosophie&amp;quot; de &amp;quot;Local adjustments&amp;quot;...utiliser le ΔE&lt;br /&gt;
&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
Je ne reprends pas toutes les étapes, seulement celle de l'ouverture de l'outil&lt;br /&gt;
* &amp;quot;Add tool to current spot...&amp;quot;, &amp;quot;Common color mask&amp;quot; - &amp;quot;Normal&amp;quot;, et à titre pédagogique pas d'autres outils ouverts.&lt;br /&gt;
* pour l'élaboration du masque, je vais simplifier au maximum en ne prenant que 2 courbes C(C) et L(L) et en prenant en compte les références du RT-spot &lt;br /&gt;
* notez que les 2 curseurs &amp;quot;Add / substract mask luminance&amp;quot; et  &amp;quot;Add / substract mask chrominance&amp;quot; ne sont pas à zéro, afin que l'utilisateur ne soit pas dérouté par une absence de réponse du système; les 2 valeurs -10 sont arbitraires et de faible amplitude.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Masque luminance=====&lt;br /&gt;
J'ai choisi une action simple sur la luminance et de relativement faible amplitude.&lt;br /&gt;
* remarquez la position du sommet de la courbe sur la transition grise....Le masque &amp;quot;Luminance&amp;quot; s'accorde avec la référence du RT-spot&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Masque luminance]]&lt;br /&gt;
&lt;br /&gt;
=====Masque chrominance=====&lt;br /&gt;
* remarquez la position du sommet de la courbe sur la transition grise....Le masque &amp;quot;Chrominance&amp;quot; s'accorde avec la référence du RT-spot&lt;br /&gt;
[[File:common-mask-showC1.jpg|600px|thumb|center|Masque Chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
C'est à partir d'ici que vous pourrez jouer sur le deltaE (ΔE), entre &amp;quot;Image +- Masque&amp;quot; et &amp;quot;Image originale&amp;quot;&lt;br /&gt;
* essayez d’accroître ou réduire &amp;quot;Scope&amp;quot; (attention c'est le curseur de &amp;quot;common color mask&amp;quot; qui a une action).&lt;br /&gt;
* essayez les réglages de &amp;quot;settings&amp;quot; - &amp;quot;Shape detection&amp;quot; : &amp;quot;Threshold ΔE scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;Balance ΔE ab-L&amp;quot;, &amp;quot;Balance ΔE C-H&amp;quot; &lt;br /&gt;
[[File:common-mask-previewdE1.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Allez dans &amp;quot;Show modifications with mask&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Add / substract mask luminance&amp;quot; et  &amp;quot;Add / substract mask chrominance&amp;quot; (j'aurais pu appeler ces curseurs &amp;quot;Opacité&amp;quot;)&lt;br /&gt;
[[File:common-mask-modif1.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Résultat=====&lt;br /&gt;
Vous pouvez changer:&lt;br /&gt;
* &amp;quot;Scope&amp;quot; (toujours celui de &amp;quot;Common color mask&amp;quot; qui agit sur le ΔE)&lt;br /&gt;
* activer &amp;quot;Smooth Radius&amp;quot;... qui va tenter de réduire les artefacts dus à l'élaboration du masque par les 3 courbes - C(C), L(L), LC(H).&lt;br /&gt;
* chroma&lt;br /&gt;
* agir sur la courbe &amp;quot;Contrast curve&amp;quot;&lt;br /&gt;
* essayez dans &amp;quot;settings&amp;quot; - &amp;quot;Scope Mask ΔE image&amp;quot; : ce curseur agit sur la masque et prend en compte le deltaE du masque par rapport au centre du RT-spot, c'est différent du &amp;quot;Scope&amp;quot; (le premier curseur de &amp;quot;Color color mask&amp;quot;) qui agit par différence entre l'image originale et le masque que vous avez créé &lt;br /&gt;
&lt;br /&gt;
Passez en mode &amp;quot;advanced&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Soft Radius&amp;quot;, celui-ci va réduire les artefacts entre l'image originale et celle obtenue après &amp;quot;addition&amp;quot; du masque. Par défaut même en mode &amp;quot;normal&amp;quot; (il est à 1) ce qui induit un petit changement - même sans masque - dans &amp;quot;show modifications&amp;quot;.&lt;br /&gt;
* essayez &amp;quot;Laplacian threshold&amp;quot;, et notez les différences avec &amp;quot;Smooth radius&amp;quot;&lt;br /&gt;
* essayez &amp;quot;Gamma mask&amp;quot; et &amp;quot;Slope mask&amp;quot;&lt;br /&gt;
* essayez de changer la structure par un des outils fournis : &amp;quot;Mask Structure&amp;quot;, &amp;quot;Mask Blur&amp;quot;, &amp;quot;Mask levels local contrast&amp;quot;&lt;br /&gt;
* essayez &amp;quot;Graduated Filter&amp;quot;&lt;br /&gt;
[[File:common-mask1.jpg|600px|thumb|center|Résultat]]&lt;br /&gt;
&lt;br /&gt;
Maintenant nous allons améliorer cette image &amp;quot;common color mask&amp;quot; avec l'outil &amp;quot;Merge file&amp;quot; de &amp;quot;Color and Light&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=====Ajouter un nouveau RT-spot &amp;quot;Color &amp;amp; light - Advanced&amp;quot;=====&lt;br /&gt;
Toujours à titre pédagogique, sans recherche artistique, je vais expliquer comment réaliser 3 modes de fusion parmi les 21 possibles&lt;br /&gt;
* ajoutons un nouveau RT-spot&lt;br /&gt;
* créons un outil &amp;quot;Color &amp;amp; Light&amp;quot; - &amp;quot;Advanced&amp;quot;&lt;br /&gt;
* réglons correctement &amp;quot;Scope&amp;quot; (avec Preview ΔE)&lt;br /&gt;
* choisissons 3 réglages pour accroître la luminance, le contraste et la chrominance&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Ajout d'un RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Préparer le &amp;quot;merge&amp;quot; (fusion en français)=====&lt;br /&gt;
* choisir &amp;quot;Previous spot&amp;quot;, on va donc fusionner le nouveau RT-spot (Color and Light) et le précédent (Common color mask)&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Préparer fusion]]&lt;br /&gt;
&lt;br /&gt;
=====Première fusion en mode &amp;quot;normal&amp;quot;=====&lt;br /&gt;
* choisir le mode de fusion &amp;quot;normal&amp;quot;&lt;br /&gt;
* arbitrairement j'ai choisi 3 réglages : Merge background = 54.2 prend en compte le deltaE entre les 2 couches; Opacity = 54.2 - environ 50% pour chacun; Contrast threshold = 12.5 - prend en compte les différences aplats / structure&lt;br /&gt;
* les deux valeurs 54.2 identiques sont le fait du hasard, il est évident que vous pouvez choisir d'autres valeurs 43, 68, etc.&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Fusion Normal]]&lt;br /&gt;
&lt;br /&gt;
=====Deuxième fusion en mode &amp;quot;SoftLight (legacy)&amp;quot;=====&lt;br /&gt;
* changer de mode de fusion et choisir &amp;quot;Softlight (legacy)&amp;quot; &lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Fusion Softlight (legacy)]]&lt;br /&gt;
&lt;br /&gt;
======Troisième fusion en mode &amp;quot;Color Burn&amp;quot;======&lt;br /&gt;
* changer de mode de fusion et choisir &amp;quot;Color Burn&amp;quot;&lt;br /&gt;
* bien sûr ces 3 choix de modes de fusion sont arbitraires&lt;br /&gt;
* notez les différences de rendus en luminance et chrominance &lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Fusion Color Burn]]&lt;br /&gt;
&lt;br /&gt;
=====Plus=====&lt;br /&gt;
Bien sûr, vous pouvez créer autant de &amp;quot;Common color mask&amp;quot; que vous souhaitez, dupliquer ce &amp;quot;masque&amp;quot; près de l'autre avec des réglages proches...&lt;br /&gt;
&lt;br /&gt;
Rappel sur les courbes des masques : C(C), L(L), LC(H)&lt;br /&gt;
* Ces courbes permettent de créer le masque&lt;br /&gt;
* Pour chacune des courbes la ligne de séparation verticale gris foncé / gris clair représente les 3 références du RT-spot respectivement : Luminance, Chroma et Teinte (hue)&lt;br /&gt;
* lorsque la courbe est de premier type ci-dessous, le sommet de la courbe sur la sélection (ici L), la sélection deltaE est améliorée&lt;br /&gt;
* lorsque la courbe est de deuxième type ci-dessous - la sélection de teinte pour le masque correspond à la références teinte du RT-spot (le sommet de la courbe sur la sélection - ici H -), comme la courbe inversée, cette couleur (ou L, ou C) sera réduite et l'incidence sur la luminance et la chrominance du masque maximum.&lt;br /&gt;
* lorsque la courbe est de troisième type ci-dessous, la sélection de teinte pour le masque ne correspond pas à la références teinte du RT-spot, et la courbe inversée, cette couleur (ou L, ou C) sera réduite et l'incidence sur la luminance et la chrominance du masque maximum.&lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Masque sélection]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* J'ai fait le choix pour cette démonstration d'une image à 2 dominantes, magenta (fleur) et vert (feuilllage). Une image plus variée (ciel, mer, montagne, maisons, champs, fleurs, portraits...) va autoriser un usage plus riche des masque, car plus de couleurs / luminance / chrominance à prendre en compte.&lt;br /&gt;
* j'ai aussi fait le choix de rester dans la &amp;quot;philosophie&amp;quot; de &amp;quot;Local adjustments&amp;quot;, s'appuyer sur les références du RT-spot. J'aurais pu faire l'inverse, comme évoqué dans les courbes ci-dessus. Les résultats auraient été totalement différents.&lt;br /&gt;
* De même, j'ai fait le choix dans la fusion (merge) de choisir la même gamme de couleur que pour le masque, j'aurais pu faire un autre choix pour le deuxième RT-spot, en le positionnant sur le feuillage...La fusion aurait été différente, avec moins de variation dans les fleurs...c'est un choix pédagogique&lt;br /&gt;
&lt;br /&gt;
====Une approche de traitement complet  - Portrait sombre - peau granuleuse - Mairi====&lt;br /&gt;
Le portrait de Mairi, va être l'occasion d’utiliser plusieurs outils:&lt;br /&gt;
* accroître &amp;quot;l'exposition&amp;quot; de l'image pour qu'elle soit moins sombre&lt;br /&gt;
* utiliser &amp;quot;CBDL&amp;quot; pour adoucir la peau et &amp;quot;Clarity&amp;quot; pour éclaircir le visage&lt;br /&gt;
* réaliser un &amp;quot;graduated filter&amp;quot; pour dégager les ombres du visage à droite&lt;br /&gt;
* utiliser 3 &amp;quot;excluding spot&amp;quot; pour &amp;quot;exclure&amp;quot; les yeux et les lèvres du traitement&lt;br /&gt;
* utiliser un &amp;quot;masque LC(H)&amp;quot; pour &amp;quot;exclure&amp;quot;  les cheveux de l'adoucissement (et donc perte de définition)&lt;br /&gt;
* comparer avant après&lt;br /&gt;
* remarque : les réglages ont donnés à titre indicatif, tout est fonction de son goût....&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichie raw (Copyright Pat David -  Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Accroître exposition=====&lt;br /&gt;
Exposure + 0.5&lt;br /&gt;
J'aurais pu utiliser un RT-spot pour limiter la zone qui sera accrue en exposition au lieu d'un accroissement global de l'exposition. &lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposition]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Contrast By Detail Level=====&lt;br /&gt;
* Créer un RT-spot avec un &amp;quot;gros&amp;quot; Spot Size = 47&lt;br /&gt;
* Réduction progressive du contraste pour les niveaux 0 à 4&lt;br /&gt;
* Clarity à 60&lt;br /&gt;
* Scope à 40&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|Contrast by detail levels]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
*Créer un autre spot &amp;quot;Color &amp;amp; Light&amp;quot;&lt;br /&gt;
*Graduated filter : luminance -0.6 ; Gradient angle = 5&lt;br /&gt;
* vous pouvez aussi (advanced) jouer sur la chrominance &lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Exclure les yeux et les lèvres=====&lt;br /&gt;
* Créer 3 RT-spot &amp;quot;exluding&amp;quot; sur les yeux et les lèvres&lt;br /&gt;
* agir sur Scope (excluding) pour obtenir le résultat recherché&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Masque pour exclure les cheveux=====&lt;br /&gt;
* revenir au premier RT-spot&lt;br /&gt;
* aller sur masque&lt;br /&gt;
* show mask&lt;br /&gt;
* utiliser la courbe LC(H)&lt;br /&gt;
* repérer la couleur de la peau (séparation des zones grises)&lt;br /&gt;
* abaisser la courbe comme sur le graphique (ou similaire)&lt;br /&gt;
* agir sur Smooth radius mask&lt;br /&gt;
* agir éventuellement sur &amp;quot;gamma&amp;quot;, &amp;quot;slope&amp;quot; et &amp;quot;contrast curve&amp;quot; mask&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Masque&lt;br /&gt;
&lt;br /&gt;
=====Résultat=====&lt;br /&gt;
* mettre mask sur none&lt;br /&gt;
* cocher &amp;quot;enable mask&amp;quot;&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Résultat]]&lt;br /&gt;
&lt;br /&gt;
=====Comparaison avant après=====&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center| Avant après]]&lt;br /&gt;
&lt;br /&gt;
=====Une alternative - remplacer Contrast by detail levels par &amp;quot;wavelet contrast by level&amp;quot;=====&lt;br /&gt;
* Le module &amp;quot;wavelet&amp;quot; est plus performant que Contrast By Detail Levels....il peut sembler plus complexe...vu le nombre d'options.&lt;br /&gt;
* Il permet à contrario de CBDL de différencier l'action avec notamment les curseurs &amp;quot;Attenuation Response&amp;quot; et &amp;quot;offset&amp;quot; : au lieu d'avoir une réponse linéaire sur le signal de la décomposition  - même amplitude pour les petites valeurs (bruit) et les grosses valeurs - l'amplification (ou la réduction) prend en compte la valeur du signal.&lt;br /&gt;
* bien sûr vous disposez aussi d'une fonction &amp;quot;Clarity&amp;quot;&lt;br /&gt;
 [[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level et Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Et bien sûr, vous pouvez utiliser un masque avec &amp;quot;wavelet&amp;quot;=====&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Masque wavelet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Ajouter une bordure à une image====&lt;br /&gt;
=====Généralités=====&lt;br /&gt;
Vous pouvez utiliser les ajustements locaux pour ajouter une bordure à une image.&lt;br /&gt;
Cette bordure peut être: blanche, noire, grise ou colorée.&lt;br /&gt;
&lt;br /&gt;
Vous pouvez télécharger les fichiers pp3 suivants.&lt;br /&gt;
Bordure Blanche [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Bordure Grise [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Bordure Colorée [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Bordure Noire [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
Contrairement à d'autres logiciels qui ajoutent une bordure à l'extérieur de l'image (en accroissant sa taille), cette procédure rogne l'image de la partie concernée par le bord.&lt;br /&gt;
&lt;br /&gt;
Vous pouvez bien sûr personnaliser ces bordures : changer les dimensions (bords verticaux ou horizontaux), changer la couleur. Vous pouvez utiliser &amp;quot;partial paste&amp;quot; pour mettre en place cette modification sur les images de votre choix.&lt;br /&gt;
&lt;br /&gt;
Je tiens à remercier Arturo Isilvia pour sa contribution à ces presets.&lt;br /&gt;
&lt;br /&gt;
=====Les deux RT-spots=====&lt;br /&gt;
Ce module est constitué de deux RT-spots:&lt;br /&gt;
* le premier, utilise le mode &amp;quot;full image&amp;quot;. Il rend le fond de l'image noir, blanc, gris ou coloré.&lt;br /&gt;
** il met en œuvre l'outil &amp;quot;Color and Light&amp;quot; &lt;br /&gt;
*** pour les bordures noires, blanches ou grises, l'outil &amp;quot;RGB Tones Curve&amp;quot; est utilisé.&lt;br /&gt;
*** pour les bordures colorées, c'est l'outil &amp;quot;Color correction grid&amp;quot; qui est utilisé. &lt;br /&gt;
* le second, est en mode &amp;quot;excluding&amp;quot;, utilise un rectangle qui assure les limites de la bordure&lt;br /&gt;
&lt;br /&gt;
=====Le premier RT-Spot=====&lt;br /&gt;
======Détails des réglages du premier RT-Spot - Bords noirs, Gris, Blancs======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Utiliser RGB Tones Curves]]&lt;br /&gt;
* Color and Light est utilisé en mode &amp;quot;Avancé&amp;quot;&lt;br /&gt;
* Seul l'outil RGB Tone Curve est utilisé. Le réglage correspond à l'exemple ci-dessus (bord gris). &lt;br /&gt;
* Dans &amp;quot;Settings&amp;quot; - transition est réglé sur 100.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Détails des réglages du premier RT-Spot - Bords colorés======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Utiliser Color correction grid]]&lt;br /&gt;
* Lightness, Contrast, Chrominance sont réglés à -100; Gamma à 0.5&lt;br /&gt;
* Choisissez la couleur de votre choix dans &amp;quot;Color correction grid&amp;quot;- ici le réglage de base est vert.&lt;br /&gt;
* Dans &amp;quot;Settings&amp;quot; - les réglages suivants sont nécessaires : transition = 100, Scope = 100, DeltaE scope threshold = 10.&lt;br /&gt;
&lt;br /&gt;
=====Le deuxième RT-Spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Réglages du 2ème Spot - excluding]]&lt;br /&gt;
Notez les réglages suivants:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* La &amp;quot;shape method&amp;quot; utilisée est &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (dans “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). Vous pouvez facilement changer les valeurs de &amp;quot;Right&amp;quot;  et &amp;quot;Bottom&amp;quot; qui permettent ainsi de régler les dimensions de la bordure:&lt;br /&gt;
** &amp;quot;Right&amp;quot; change la largeur (partie verticale).&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; change la hauteur (partie horizontale).&lt;br /&gt;
&lt;br /&gt;
==HDR-SDR Première approche : Log encoding – Cam16 – JzCzHz – Sigmoid==&lt;br /&gt;
Les images à dynamique élevée sont l'un des problèmes récurrents du traitement d'images. Il existe déjà plusieurs algorithmes:&lt;br /&gt;
*  dans les onglets Exposition et Couleur de RawTherapee qui peuvent être utilisés pour réduire la plage dynamique, avec plus ou moins de succès :Dynamic Range Compression, Shadows/Highlights,&lt;br /&gt;
* dans l'onglet Local, Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ils ont été complétés par un module supplémentaire de codage logarithmique '''Log Encoding''' dans l'onglet Ajustements locaux pour faciliter le traitement des images à gamme dynamique élevée. Une version simplifiée, '''Using the Cam16 and HDR functions''' du module Color Appearance &amp;amp; Lighting (Ciecam02/16) de l'onglet Advanced du menu principal a également été adaptée aux exigences spécifiques des réglages locaux et étendue pour prendre en compte le pic de luminance HDR. Il inclut également une fonction '''experimental JzCzHz''' (en mode Avancé) pour améliorer le traitement HDR.&lt;br /&gt;
&lt;br /&gt;
Attention, les explications ci-après peuvent être sujet à controverse du fait, notamment pour JzCzHz et une partie de Cam16:&lt;br /&gt;
* absence de documentation pour JzCzHz;&lt;br /&gt;
* mauvais fonctionnement de l'algorithme de base des chercheurs (défaut de saturation, mauvais comportement avec les ombres profondes, ...) pour JzCzHz;&lt;br /&gt;
* mon interprétation personnelle, pour résoudre les dysfonctionnements.&lt;br /&gt;
 &lt;br /&gt;
==='''Log encoding'''===&lt;br /&gt;
Cette partie de Rawtherapee est :&lt;br /&gt;
* très proche dans son code et son utilisation du module « Log Tone mapping » de ART – merci à Alberto Griggio de l'avoir conçu,&lt;br /&gt;
* proche du module « Filmic » de Darktable (travaillant en mode RGB)&lt;br /&gt;
* tous s'inspirent des travaux sur le codage logarithmique  élaboré par « The Academy Color Encoding System (ACES) ». &lt;br /&gt;
&lt;br /&gt;
Dans une première étape, pour une image donnée, qu'elle soit ou non HDR, l'algorithme calcule l'écart par rapport au gris moyen théorique – gris à 18% - du noir le plus prononcé et du blanc le plus vif, exprimés en unité photographique (indice de lumination Ev- en relation avec la luminosité de la scène).&lt;br /&gt;
Ces deux valeurs, ainsi que la luminance moyenne de la scène (Mean luminance Yb%) sont utilisés par l’algorithme – automatiquement (ou avec reprise manuelle) - pour modifier l'équilibre des valeurs RGB, réduisant de fait les contrastes, en rehaussant les ombres et réduisant les hautes lumières, sans trop dénaturer le rendu de l'image.&lt;br /&gt;
&lt;br /&gt;
Dans une seconde et troisième étape, les données sont corrigées manuellement par l'utilisateur – accroissement du contraste local (affaibli par la conversion 'Log') et ajustement des conditions de visualisations  au moment de l'affichage de l'image sur les périphériques de sortie.&lt;br /&gt;
====Exemple Adaptation chromatique====&lt;br /&gt;
La première étape : réaliser une balance des blancs - presque mathématiquement parfaite - en utilisant &amp;quot;White Balance&amp;quot; - &amp;quot;Auto&amp;quot; - &amp;quot;Temperature correlation&amp;quot; - (même exemple et mêmes réglages que dans le tutoriel &amp;quot;Ciecam advanced tab&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Fichier raw (Rawtherapee - Creative Common Attribution-share Alike 4.0)[https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|Balance des blancs - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choisir un réglage &amp;quot;Local adjustements&amp;quot; adapté - Préparation=====&lt;br /&gt;
* Sélectionner &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
* Spot &amp;quot;rectangle&amp;quot;, très largement au delà des limites du preview (pour permettre de déplacer le centre du RT-spot)&lt;br /&gt;
* transition = 100&lt;br /&gt;
* mettez en place quelques &amp;quot;lockable color picker&amp;quot;&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Adaptation chromatique - Préparation]]&lt;br /&gt;
&lt;br /&gt;
=====Sélectionnez Log encoding=====&lt;br /&gt;
Choisissez : Add tool to current spot : Log encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Adaptation chromatique - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Essayez de changer la place du centre du RT-spot&lt;br /&gt;
* Essayez de change &amp;quot;Scope&amp;quot; : 40 - 60 - 80 - 100&lt;br /&gt;
* Observez les résultats&lt;br /&gt;
* Mais l'image est toujours jaunâtre&lt;br /&gt;
&lt;br /&gt;
Nouvelle Interface - branch lacam16&lt;br /&gt;
[[File:catLAlog2.jpg|600px|thumb|center| Log encoding with Whites distribution &amp;amp; Blacks distribution]]&lt;br /&gt;
&lt;br /&gt;
=====Modifier Chromatic adaptation - cat02=====&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Adaptation chromatique - Log encoding - Cat02]]&lt;br /&gt;
* Refroidir l'image en déplaçant le curseur &amp;quot;Chromatic adaptation cat02&amp;quot; vers la gauche&lt;br /&gt;
* pour refroidir 10 unités correspond à une baisse de Température de l'illuminant de 300K&lt;br /&gt;
* Essayez -23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Image à forte dynamique + Ciecam====&lt;br /&gt;
L'image choisie est difficile (la même que celle pour Ciecam advanced tab) : ombres très marquées et arrière plan éclairé en plein soleil.&lt;br /&gt;
Utilisez les traitements par défaut de Rawtherapee.&lt;br /&gt;
Positionnez des &amp;quot;Lockable color picker&amp;quot; afin de visualiser le traitement.&lt;br /&gt;
&lt;br /&gt;
Fichier raw (Pixls.us Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Préparation Lighting Ciecam]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Log encoding + Ciecam=====&lt;br /&gt;
Choisissez &amp;quot;add tool to current spot&amp;quot; : Log encoding&lt;br /&gt;
Pour l'exemple, et la comparaison avec &amp;quot;Ciecam &amp;amp; Light&amp;quot;, le choix (arbitraire) est fait de:&lt;br /&gt;
* spot rectangle - au delà du preview&lt;br /&gt;
* transition = 100&lt;br /&gt;
* scope = 79&lt;br /&gt;
* niveau de complexité : advanced&lt;br /&gt;
* Pressez le bouton &amp;quot;Automatic&amp;quot;...&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Déplacez le RT-spot, observez les effets&lt;br /&gt;
* Changez &amp;quot;Scope&amp;quot; , observez les effets &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Log encoding et les réglages Ciecam=====&lt;br /&gt;
* Scene conditions , choisissez &amp;quot;Surround = Dim&amp;quot;; l'image va s'éclaircir&lt;br /&gt;
* Image Adjustments, Saturation (s) = 30, Contrast (J) = -10&lt;br /&gt;
* Observez l'image dans les ombres..&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam saturation (s) - contraste (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Maintenant, ouvrez l'expander &amp;quot;All tools&amp;quot;&lt;br /&gt;
* essayez Colorfulness (M) à la place de saturation (s)&lt;br /&gt;
* essayez Contrast (Q) à la place de Contrast (J)&lt;br /&gt;
* agissez sur Lightness&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Préparation=====&lt;br /&gt;
Encore une autre manière de réaliser un Dodge and Burn avec l'appoint de Ciecam&lt;br /&gt;
Positionnez le RT-spot sur le visage, et mettez 2 &amp;quot;Lockable color pickers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Fichier raw (Copyright - Jean Christophe Frisch - Common Attribution-share Alike 4.0)[https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Préparation]]&lt;br /&gt;
&lt;br /&gt;
=====Utiliser Log encoding - manuel et Ciecam=====&lt;br /&gt;
* Add tool to current spot : Log encoding&lt;br /&gt;
* complexité : advanced&lt;br /&gt;
* Cliquez sur automatic&lt;br /&gt;
* puis accroissez légèrement White Ev, jusqu'à obtenir l'effet souhaité (dans l'exemple de 3.0 à 5.0)&lt;br /&gt;
* accroissez légèrement la Saturation (s)&lt;br /&gt;
* déployez expander &amp;quot;all tools&amp;quot;, et réduisez légèrement Brightness (Q)&lt;br /&gt;
* essayez les autres réglages : Dim, lightness, etc.&lt;br /&gt;
* vous pouvez agir sur Scope et déplacer le RT-spot &lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Préparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding et récupération des hautes lumières'''===&lt;br /&gt;
Voir dans : Quelques particularités du mode local (par rapport à Lab adjustements) [[Local Lab controls/fr#Log Encoding | Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
L'utilisation de &amp;quot;Log Encoding&amp;quot; peut quelque fois aboutir à des résultats inattendus. Si l'image contient des hautes lumières qui ont été surexposées à la prise de vue, la récupération est obligatoire. Mais dans ce cas, &amp;quot;Encoding log&amp;quot; va &amp;quot;écraser&amp;quot; ces hautes lumières reconstruites, aboutissant à des effets peu agréables.&lt;br /&gt;
Nous utiliserons 2 manières de préserver ces hautes lumières:&lt;br /&gt;
* avec un masque et un processus de récupération&lt;br /&gt;
* avec des &amp;quot;excluding spots&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Préparation====&lt;br /&gt;
Fichier raw (Pixls.us - Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
Fichier pp3 [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Plusieurs étapes à la préparation (non reprises dans ce descriptif)&lt;br /&gt;
* régler la balance des blancs : à part la personne qui a pris cette image, on ne sait rien des conditions de prises de vue. A l'arrière plan sont-ce des LED ? ou des lampes à incandescence ? Et pour le premier plan ?&lt;br /&gt;
** vous pouvez laisser l'image telle quelle&lt;br /&gt;
** ou utiliser la balance des blancs automatique : &amp;quot;temperature correlation&amp;quot;&lt;br /&gt;
* &amp;quot;highlight reconstruction&amp;quot; : j'ai utilisé ici l'excellent algorithme de Emil Martinec &amp;quot;Color Propagation&amp;quot;&lt;br /&gt;
* régler l'arrière plan des masques afin que la lecture des valeurs L*a*b* des &amp;quot;Lockable Color pickers&amp;quot; correspondent aux valeurs réelles&lt;br /&gt;
** dans &amp;quot;Local adjustments&amp;quot; - &amp;quot;Settings&amp;quot; -&amp;quot;Mask and merge&amp;quot; - &amp;quot;Background color for luminance and color masks = 0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Préparation du RT-Spot&lt;br /&gt;
* choisissez &amp;quot;Rectangle&amp;quot;&lt;br /&gt;
* positionnez les délimiteurs en dehors du &amp;quot;preview&amp;quot;&lt;br /&gt;
* réglez la transition à une valeur assez élevée&lt;br /&gt;
* positionnez sur l'image une série de &amp;quot;Lockable Color pickers&amp;quot; &lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Appliquer Encoding Log====&lt;br /&gt;
* ajouter l'outil &amp;quot;Encoding Log&amp;quot; : Add tool to current spot...&lt;br /&gt;
* sélectionnez &amp;quot;advanced&amp;quot; (ou standard)&lt;br /&gt;
* cliquez sur le bouton &amp;quot;Automatic&amp;quot;&lt;br /&gt;
* réglez &amp;quot;Scope&amp;quot; à une valeur élevée : 80 ou plus&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Log Encoding&amp;quot; va faire son travail notamment sur l'avant plan, mais l'arrière plan avec les hautes lumières &amp;quot;reconstruites&amp;quot; précédemment voit les couleurs se délaver, la luminance maximum baisser.&lt;br /&gt;
&lt;br /&gt;
D'autre part, l'image après cette opération semble trop saturée et l'exposition mal répartie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration du masque====&lt;br /&gt;
Nous allons élaborer un masque qui sera utilisé d'une manière différente des autres processus dans RT.&lt;br /&gt;
Ce masque sera utilisé &amp;quot;en direct&amp;quot; et son analyse va servir à combiner l'image sans l'action de &amp;quot;Encoding log&amp;quot;, avec l'image traitée avec &amp;quot;Log Encoding&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Selon les réglages de &amp;quot;Recovery based on luminance mask&amp;quot;:&lt;br /&gt;
* les zones sombres et noires du masque donneront la possibilité de ramener l'image combinée au plus près de l'image originale.&lt;br /&gt;
* les zones très claires ou blanches du masque donneront la possibilité de ramener l'image combinée au plus près de l'image originale.&lt;br /&gt;
* la zone intermédiaire conservera les réglages de &amp;quot;Encoding log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Dans le cas présent je me suis servi de la courbe LC(H), d'autres images nécessiteront la courbe L(L). A noter que la courbe C(C) n'a aucune incidence sur le &amp;quot;mélange&amp;quot; mais peut être utilisée pour améliorer la sélection. &lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Récupération partielle des hautes lumières avec masque====&lt;br /&gt;
* Assurez vous que le masque est activé : case &amp;quot;Enable mask&amp;quot; cochée&lt;br /&gt;
* dépliez l'expander &amp;quot;Recovery based on luminance mask&amp;quot;&lt;br /&gt;
* agissez sur &amp;quot;Recovery threshold&amp;quot; : plus le curseur sera proche de &amp;quot;2&amp;quot;, plus les zones sombres et très claires du masque seront prises en compte, plus ces zones seront ramenées aux valeurs de l'image originale&lt;br /&gt;
* agissez sur les curseurs &amp;quot;Dark area luminance threshold&amp;quot; et &amp;quot;Light area luminance threshold&amp;quot; pour inclure ou exclure certaines parties de l'image. Les valeurs correspondantes (ici dark = 25.5 et Light = 98.3) sont les 2 limites en deçà et au delà desquelles les actions du masque seront progressivement prises en compte.&lt;br /&gt;
* agissez éventuellement sur &amp;quot;decay&amp;quot; pour régler la &amp;quot;vitesse&amp;quot; de la décroissance. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Récupération des hautes lumières avec 'Excluding spot'====&lt;br /&gt;
Bien sûr la &amp;quot;force&amp;quot; de &amp;quot;Local adjustments&amp;quot; est toujours présente. Vous pouvez rétablir l'image originale en utilisant les &amp;quot;excludings spots&amp;quot;....&lt;br /&gt;
Les réglages sont arbitraires... &lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Ajustement final avec Ciecam16====&lt;br /&gt;
Maintenant, une fois les divers traitement &amp;quot;Color propagation&amp;quot;, &amp;quot;Local adjustments&amp;quot; réalisés, on peut affiner le résulat. Dans ce cas j'ai choisi divers réglages Ciecam (ici Ciecam 2016).&lt;br /&gt;
* accroissement du contraste&lt;br /&gt;
* réduction de la saturation, notamment pour la peau&lt;br /&gt;
* changement de l'adaptation chromatique, pour rendre l'image un peu plus &amp;quot;froide&amp;quot;...&lt;br /&gt;
* mais tout est assez arbitraire....selon la perception de chacun&lt;br /&gt;
&lt;br /&gt;
Dernière remarque:&lt;br /&gt;
* l'image est particulièrement bruitée&lt;br /&gt;
* je n'ai pas souhaité &amp;quot;ajouter&amp;quot; ce traitement, mais il est évident qu'il faut le faire.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Autre exemple avec Log Encoding'''===&lt;br /&gt;
Les images à forte dynamique sont un des problèmes récurrents du traitement d'image. Plusieurs algorithmes dans Rawtherapee permettent un traitement plus ou moins complet de ces problèmes : Dynamic range compression, Shadows / highlight, Tone Equalizer, Tone Response Curve, etc.&lt;br /&gt;
* dans le cas présent je tiens à montrer l'outil &amp;quot;Encoding Log&amp;quot; (Origin Filmic - Darktable - adapté à ART par A.Griggio). J'ai adapté légèrement cet outil à Rawtherapee - &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
* je l'ai associé à un autre objectif pédagogique : réaliser un gradient de luminance, sans faire appel au Graduated filter pourtant présent dans le menu &amp;quot;Encoding Log&amp;quot;&lt;br /&gt;
* Trois étapes : préparation, réglages automatiques, ajustements&lt;br /&gt;
&lt;br /&gt;
====Préparation====&lt;br /&gt;
* Régler le RT-spot de telle manière que :&lt;br /&gt;
** le centre se trouve en bas à gauche de l'image&lt;br /&gt;
** le coin supérieur droit soit aux limites de l'image&lt;br /&gt;
* Aller à &amp;quot;Add tool to current spot...&amp;quot; : &amp;quot;Encoding log&amp;quot; (j'ai volontairement désactivé l'outil)&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
Fichier raw (Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Réglages automatiques====&lt;br /&gt;
* Appuyez sur le bouton &amp;quot;Automatic&amp;quot;&lt;br /&gt;
* l'image va s'éclaircir&lt;br /&gt;
* re-cliquez sur le bouton &amp;quot;Automatic&amp;quot; pour mieux percevoir les réglages&lt;br /&gt;
* Black Ev = -6.7, White Ev = 6.9 : traduisent une dynamique de 13.6 EV très importante&lt;br /&gt;
* Source gray point : value (réglée en automatique) = 1.2 &lt;br /&gt;
* ces 2 réglages (que vous pouvez changer) traduisent les calculs réalisés en amont du processus après la conversion vers un espace de travail&lt;br /&gt;
[[File:encodlogaut.jpg|600px|thumb|center|Automatique]]&lt;br /&gt;
&lt;br /&gt;
====Ajustements====&lt;br /&gt;
Vous pouvez maintenant adapter l'image à vos souhaits:&lt;br /&gt;
* jouer sur le gradient diagonal en agissant sur &amp;quot;settings&amp;quot; - &amp;quot;Transitions&amp;quot; : &amp;quot;Transition value&amp;quot; = 45. vous pouvez aussi agir sur &amp;quot;Transition decay&amp;quot; et &amp;quot;Transition differentiation XY&amp;quot; (essayez) &lt;br /&gt;
* agir sur la répartition de l'action à l'intérieur de l'image en agissant sur Scope (Encoding log) = 50&lt;br /&gt;
* Changer la luminance globale de l'image en agissant sur &amp;quot;Target Gray point&amp;quot; = 22.0&lt;br /&gt;
[[File:encodloggrad.jpg|600px|thumb|center|Gradient et ajustements]]&lt;br /&gt;
&lt;br /&gt;
==='''Utilisation de Cam16 et des fonctionnalités HDR'''===&lt;br /&gt;
Voir dans Quelques particularités du mode local (par rapport à Lab adjustements):[[Local Lab controls/fr#Color appearance (Cam16 &amp;amp; JzCzHz)| Cam16 et possibilités HDR]]&lt;br /&gt;
====Préambule==== &lt;br /&gt;
Le module Cam16 (Color appearance(Cam16 &amp;amp; JzCzHz) permet également de prendre en compte certaines des caractéristiques d'une image qui autoriseront un traitement HDR. Pour rappel, que ce soit « Log encoding », « JzCzHz » ou Cam16 ne sont qu'une étape vers HDR car l'ensemble du processus doit être pris en compte, ce qui n'est pas le cas actuellement notamment pour la prise en compte complète du moniteur HDR (y compris le code utilisant LCMS), la plupart de ceux en service étant SDR.&lt;br /&gt;
&lt;br /&gt;
====Différences avec le module (main) « Color appearance &amp;amp; Lighting (Ciecam02/16)»====&lt;br /&gt;
* prise en compte des caractéristiques de « Local adjustments » (deltaE, transitions, masques...) ;&lt;br /&gt;
* simplification du processus d'adaptation chromatique ;&lt;br /&gt;
* moins de courbes ;&lt;br /&gt;
* prise en compte simplifiée de la fonction PQ (Perceptual Quantizer) : cette fonction positionnée au début du traitement Cam16, change le processus interne de calcul des valeurs Brightness (Q), Lightness (J), Colorfullness (M), Saturation (s) et Chroma (C).&lt;br /&gt;
* possibilité d'utiliser « Log encoding Q » ou « Sigmoid Q » en prenant ou non en compte « Black Ev » et « White Ev », c'est à dire la dynamique d'exposition (Dynamic Range).&lt;br /&gt;
* possibilité d'utiliser 'Whites distribution' et 'Blacks distribution' [[Local_Adjustments/fr#Whites_distribution_&amp;amp;_Blacks_distribution | Whites &amp;amp; Blacks distribution]]&lt;br /&gt;
&lt;br /&gt;
====Quelques rappels====&lt;br /&gt;
* les valeurs de « Scene conditions » sont calculées, d'une part par les algorithmes de Cam16 et, d'autre part par un processus situé en amont de « Local adjustments », juste après les profils « input », le dématricage, et le choix du profil de travail (working profile) qui rappelons le, est entièrement en mode linéaire.&lt;br /&gt;
* Les conversions RGB=&amp;gt;Lab en début du processus « Local adjustments » (LA) et « Lab=&amp;gt;RGB » en fin de processus LA ne changent pas la DR (Dynamic Range). Si une image présente une DR de 15Ev avant le module « LA », elle présente sensiblement la même après le module « LA » (les différences tiennent bien sûr au traitement que l'utilisateur aura réalisé). Par contre, comme il est évoqué ici [[CIECAM02/fr#Jzazbz_-_Un_nouveau_CAM_.3F | JzCzHz et Lab]], Lab si il permet la prise en compte des très basses lumières (moins de 0.005 cd/m2), il ne permet pas l'étalement des hautes lumières au delà de 120 cd/m2 du fait de l'utilisation du gamma. Mais il préserve ces hautes lumières, jouant en quelques sortes un rôle de compression des données. Cette nécessaire évolution devra être réalisée dans des évolutions ultérieures (HDR-Lab, processus de sortie, etc.).&lt;br /&gt;
* Si dans « Settings » vous cochez les 2 cases – « Avoid color shift » et « Munsell correction only », l'ensemble du processus « LA » maintiendra une constance de la teinte (hue) quelque soient les actions sur la saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 - avec prétraitement HDR  branch lacam16n====&lt;br /&gt;
Une nouvelle approche de traitement intégré (avec le Tag 6.0,  car des incompatibiltés sont possibles) permet de :&lt;br /&gt;
* mieux exploiter le potentiel de Cam16 reconnu pour ses capacités à prendre en compte les aspects physiologiques du traitement d'image;&lt;br /&gt;
* intégrer si les images le nécessitent, un traitement HDR en amont de Ciecam - Cam16.&lt;br /&gt;
Si c'est votre premier contact avec Cam16, ou si un discours trop technique vous rebute, vous pouvez omettre de lire le paragraphe suivant.  &lt;br /&gt;
=====Deux difficultés importantes: Cam16 nécessite des variables à 6 dimensions et particularités de Q (brightness) =====&lt;br /&gt;
======Cam et les 6 dimensions======&lt;br /&gt;
Un point de programmation est nécessaire pour comprendre certaines difficultés et contraintes du travail avec Cam16 (c'est identique avec Cam02). Lors de la mise au point de Ciecam, vers 2011 2012, il est rapidement apparu que contrairement au travail en mode RGB, XYZ, ou Lab qui nécessite des déclarations de variables à 3 dimensions, Ciecam nécessite 6 dimensions : J luminance, Q brightness, C chromaticité, S saturation, M colorfullness, h hue. Ceci implique une occupation mémoire considérable et des temps de traitements importants. Le choix a été fait d'utiliser ces variables une par une et de manière séquentielle dans une boucle globale, ce qui limite l'occupation mémoire, mais présente un inconvénient majeur : l'optimisation d'une procédure appelée au milieu de la boucle est quasi impossible. En conséquence, les optimisations de fonctions telles que contraste, sigmoid, etc. sont limitées et globales.&lt;br /&gt;
&lt;br /&gt;
De plus Cam16 introduit à la fois:&lt;br /&gt;
* un éclaircissement des ombres (Lighting);&lt;br /&gt;
* un traitement perceptuel des hautes lumières;&lt;br /&gt;
qui rendent plus difficiles les traitements HDR de type &amp;quot;Log encoding&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
======Particularités de Q - Brightness======&lt;br /&gt;
* Par conception Q (brightness) contrairement à J (lightness), L (L*a*b*), et aux calculs de luminance en mode RGB, HSV,...est calculée à partir de la luminance absolue et n'a pas de limites fixes (0..1, 0..65535). &lt;br /&gt;
* Q, alors que J est dans l'intervalle [0, 1], peut atteindre des valeurs de 5 ou 10, selon les conditions de la scène. Cette réalité est une très forte contrainte sur les calculs des références des algorithmes (moyenne, seuils, etc.) et rend difficile l'automatisation des algorithmes.&lt;br /&gt;
* mais Q aboutit dans une majorité de cas, à un rendu plus naturel, plus proche de la perception humaine.&lt;br /&gt;
&lt;br /&gt;
======Déplacement des modules HDR - &amp;quot;Log encoding Q&amp;quot; et &amp;quot;Sigmoid Q&amp;quot; - précédemment intégrés à Cam16 Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]Devant les difficultés induites et décrites dans les deux précédents paragraphes, j'ai choisi:&lt;br /&gt;
* de mettre les outils HDR, ou de colorimétrie, dans un module &amp;quot;Source Data Adjustments&amp;quot;, situé dans le processus en amont de Ciecam - Cam16, mais intégré logiquement pour l'utilisateur dans le GUI de Color Appearance. Ce module contient plusieurs outils plus ou moins utiles selon la nature de l'image:&lt;br /&gt;
** Log encoding : assure un codage logarithmique des données qui permet de traiter les images avec une importante dynamique (Dynamic Range). Bien sûr vous pouvez utiliser cet outil de manière systématique, mais il n'est vraiment utile que si la DR est élevée, souvent supérieure à 10 ou plus. Son utilisation injustifiée peut amener une modification de la colorimétrie globale pas toujours facilement récupérable. Le curseur &amp;quot;Brightness compression&amp;quot; permet de limiter l'action pour les hautes valeurs de luminance.&lt;br /&gt;
** Tone Response Curve &amp;amp; Midtones : vous permet dans une majorité de cas, de modifier les images sous exposées (avec des ombres profondes), ou des images ou l'équilibre de la luminance est perturbé. Cette approche est identique aux autres modules utilisant cette &amp;quot;TRC&amp;quot; dans Rawtherapee&lt;br /&gt;
*** Gamma: permet de modifier l'action sur les lumières;&lt;br /&gt;
*** Slope: permet de déboucher les ombres;&lt;br /&gt;
*** Midtones: permet d'ajuster les tons moyens.&lt;br /&gt;
*** Smooth highlights: complète le traitement effectué par le gamma, la pente (slope) et les tons moyens (mid tones) en provoquant une légère baisse des hautes lumières. Veuillez noter que cela ne remplace pas la reconstruction des hautes lumières.&lt;br /&gt;
** Primaires &amp;amp; Illuminant, vous permet: &lt;br /&gt;
*** de retoucher la colorimétrie des images ou par exemple un mélange des illuminants amène des dérives visibles (LED), où lorsque les conditions de prise de vue (illuminant stdA, fleurs à dominante rouge, etc.) amènent le système à de réponses insatisfaisantes (saturation exagérée des bleus ou des rouges...)&lt;br /&gt;
*** Attention si vous changez le &amp;quot;Working profile&amp;quot; (Tab Color) qui par défaut est Prophoto, il vous revient d'adapter &amp;quot;Destination Primaries&amp;quot; (ce n'est pas automatique)&lt;br /&gt;
*** de modifier localement ou globalement les couleurs ou la saturation d'une image:&lt;br /&gt;
**** Le système calcule les valeurs xy de la couleur dominante de l'image et l'affiche (point gris) sur le diagramme CIExy;&lt;br /&gt;
**** Déplacer le curseur de &amp;quot;Refine colors (white-point)&amp;quot; va permettre de modifier la saturation de l'image&lt;br /&gt;
**** Modifier la position de cette couleur dominante avec les curseurs &amp;quot;Shift x&amp;quot; et &amp;quot;Shift y&amp;quot; va permettre d'ajouter ou retirer une dominante de couleurs (teinte et saturation) sans changer les primaires&lt;br /&gt;
*** Gamut control : assure un contrôle de gamut, notamment si les primaires ont été modifiées&lt;br /&gt;
*** Matrix adaptation : avec 4 choix - Bradford, Cat16, Cat02, Von Kries, XYZ scale - assure une adaptation chromatique lorsque les primaires sont changées.&lt;br /&gt;
&lt;br /&gt;
Certains de ces outils sont proches du concept de &amp;quot;Abstract Profile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments et Scene conditions=====&lt;br /&gt;
Je ne reviendrais pas sur ce qu'est &amp;quot;Scene conditions&amp;quot; (voir les tutoriels sur Ciecam), même si cette notion est plus complexe et incomprise que beaucoup d'utilisateurs ne le pensent. A titre de rappel sommaire &amp;quot;Scene conditions&amp;quot; (ou Scene-referred, ou Source, selon les usages) prend en compte les caractéristiques de l'image lors de la prise de vue. Ceci est à différencier de &amp;quot;Viewing Conditions&amp;quot; (ou Display-referred, selon les usages) qui prend en compte l'environnement de visualisation. Par exemple le système de diffusion de l'image, sa luminance, son contraste (moniteur HDR ou non, téléviseur, projecteur, imprimante,...), où encore la luminance de l'arrière plan (en plein soleil, dans une pièce sombre, etc.). Attention à ne pas dévoyer les réglages de &amp;quot;Viewing conditions&amp;quot; de leur vocation, afin de palier à des réglages imparfaits de &amp;quot;Scene conditions&amp;quot; ou de &amp;quot;Source Data Adjustments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Quels principes utilisent &amp;quot;Log encoding&amp;quot; et &amp;quot;Scene conditions&amp;quot; pour restituer une image et alimenter Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Il est nécessaire de fournir à Cam16 les notions de:&lt;br /&gt;
* Absolute luminance : ce calcul est réalisé à partir des données Exif à la prise de vue : vitesse, diaphragme, correction d'exposition,...&lt;br /&gt;
* Mean luminance, encore appelé &amp;quot;grey point&amp;quot;. Ce calcul est réalisé comme décrit au paragraphe ci-après.&lt;br /&gt;
&lt;br /&gt;
Il est nécessaire pour traiter les images HDR, celles à fortes dynamique de calculer les valeurs nécessaires à la conversion logarithmique :&lt;br /&gt;
* BlackEv et WhiteEv, ainsi que du &amp;quot;grey point&amp;quot; évoqué ci-dessus.&lt;br /&gt;
&lt;br /&gt;
Où prendre ces valeurs, comment les calculer ? La logique de &amp;quot;Scene conditions&amp;quot; amène à se placer le plus en amont du processus de traitement avec des données utilisables.&lt;br /&gt;
Le choix a été (à l'origine par ART) de prendre une copie des données de l'image juste après demoisaicing.&lt;br /&gt;
L'inconvénient de ce choix est que par définition l'image n'est pas traitée et que la distribution des couleurs et lumières est mal connu et peu fiable.&lt;br /&gt;
La difficulté introduite par la conversion logarithmique pour compresser les données (Log 2) est qu'elle n'est pas linéaire.&lt;br /&gt;
&lt;br /&gt;
Il faut donc, à la fois, prendre en compte le bruit numérique, estimer les valeurs minimales et maximales RGB et estimer un point gris. Ces réglages devraient également tenir compte des modifications possibles ultérieures de la luminance. Des formules plus ou moins empiriques du calcul de la luminance moyenne et du point gris résultant, ont été élaborées par les concepteurs d'origine. Il n'empêche que le résultat peut être décevant.&lt;br /&gt;
&lt;br /&gt;
En pratique cela revient une fois les calculs réalisés à retoucher manuellement a minima BlackEv, WhiteEv, Mean luminance (Yb% - Grey point) source, et ou Mean luminance (Yb% - Grey point - Viewing conditions&amp;quot; (ce qu'il ne faut pas faire pour ce dernier point, à réserver à l'usage de Viewing conditions), et autres ajustements ultérieurs de la luminance. D'où la difficulté d'obtenir un résultat de manière intuitive.&lt;br /&gt;
&lt;br /&gt;
Pour essayer de résoudre cette problématique, j'ai choisi d'ajouter 2 réglages d'ajustements des blancs et noirs extrêmes. Je les ai appelés &amp;quot;White distribution&amp;quot; et &amp;quot;Black distribution&amp;quot;. Il n'y a évidemment pas de règles générale pour le traitement d'une image, on affaiblit ou on renforce la partie la plus exposée ou la plus sombre de la copie de l'image. L'algorithme interne recalcule les valeurs de BlackEv, WhiteEv et de Mean luminance (Grey point) qui seront obligatoirement cohérentes. L'avantage c'est (je l'espère) un système plus intuitif. Il y a peut être d'autres moyens (?) d'y arriver; celui-ci à la mérite de fonctionner.&lt;br /&gt;
&lt;br /&gt;
Ces contrôles ne sont disponibles que si &amp;quot;Scene conditions&amp;quot; - Automatic est cochée.&lt;br /&gt;
&lt;br /&gt;
=====Le GUI de l'application a été simplifié et plus intuitif, notamment par l'utilisation d'Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Tutoriel Cam16 avec une image HDR=====&lt;br /&gt;
J'ai choisi une image du pont Alexandre III à Paris, prise fin octobre 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Fichier Raw  (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* Fichier pp3  [[File:Alexandre3-1.pp3|Alexandre3.pp3]]&lt;br /&gt;
Cette image présente une dynamique élevée un peu plus de 13Ev, avec quelques zones où l'exposition (luminance) est importante (L &amp;gt;= 100)&lt;br /&gt;
&lt;br /&gt;
Le but de ce tutoriel n'est pas de réaliser le «meilleur» traitement de cette image, mais de montrer l'intégration d'un module situé en amont de Ciecam pour produire des images à très haute dynamique, afin d'être facilement traitées ensuite par Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
J'ai ajouté un deuxième exemple, sans rapport avec le pont Alexandre III, pour montrer l'usage possible de &amp;quot;Tone Response Curve - TRC&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
======Préparation : s'assurer de bonnes conditions de démarrage - repérer les problèmes à résoudre======&lt;br /&gt;
Je fais le premier choix suivant:&lt;br /&gt;
* appliquer un profil &amp;quot;neutral&amp;quot;&lt;br /&gt;
* appliquer la balance des blancs: Auto - Temperature correlation&lt;br /&gt;
* activer Highlight reconstruction: Inpaint Opposed - Gain threshold 0.82&lt;br /&gt;
&lt;br /&gt;
Avec ces réglages de base:&lt;br /&gt;
* les ombres de la partie supérieure droite de la charpente métallique sont entièrement bouchées&lt;br /&gt;
* les hautes lumières sont acceptables (L = 97)- sans dérives apparentes de couleurs&lt;br /&gt;
* l'histogramme montre que le canal rouge est hors limites&lt;br /&gt;
* l'image manque réellement d'un rendu plaisant.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
&lt;br /&gt;
======Appliquer le rendu &amp;quot;Nikon&amp;quot; Auto-Matched Tone Curve======&lt;br /&gt;
Par défaut Rawtherapee charge le profil de rendu Nikon Z6 II&lt;br /&gt;
&lt;br /&gt;
Constat:&lt;br /&gt;
* l'image semble plus plaisante, plus équilibrée;&lt;br /&gt;
* les zones sombres sont encore plus bouchées;&lt;br /&gt;
* les hautes lumières sont hors limites (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon - Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Traiter la Dynamique élevée======&lt;br /&gt;
* Activez l'expander Source Data Adjustments&lt;br /&gt;
* Activez Log encoding&lt;br /&gt;
Examinez le résultat:&lt;br /&gt;
* Dynamic Range élevée : 13.6Ev (d'après les calculs)&lt;br /&gt;
* les ombres sont débouchées - probablement trop !&lt;br /&gt;
* les lumières sont aux limites acceptables L=98&lt;br /&gt;
* l'histogramme montre un dépassement dans les rouges&lt;br /&gt;
* globalement l'image est trop lumineuse&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Utiliser Log encoding uniquement]]&lt;br /&gt;
&lt;br /&gt;
Pour relever les ombres, réduire les lumières:&lt;br /&gt;
* régler (Scene Conditions) White distribution à -74 et Black distribution à -59 : ces choix sont assez arbitraires dépendent de la perception de chaque utilisateur.&lt;br /&gt;
* régler Midtones (Source Data Adjustments) à -70, afin de rétablir une luminance moyenne plus acceptable&lt;br /&gt;
* relever Brightness compression (Source Data Adjustments - Log encoding) à 0.90 pour abaisser un peu les lumières élevées.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Utiliser Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Rendre l'apparence de la Seine plus estivale======&lt;br /&gt;
Le temps d'automne (et la propreté de la Seine ?) rendent l'aspect de l'eau peu flatteur.&lt;br /&gt;
&lt;br /&gt;
Nous allons la rendre (un peu) plus plaisante.&lt;br /&gt;
Créons un deuxième RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
Dans Source Data Adjustments, Tone Response Curves : Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
Dans Primaries &amp;amp; illuminant - allez à Dominant Color:&lt;br /&gt;
* Déplacez le point gris représentatif de couleur dominante avec les 2 curseurs Shift x et Shift y&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* De telle façon que le point blanc (white point), le point gris (dominant color) et le point noir représentatif de la primaire rouge soient sensiblement alignés.&lt;br /&gt;
* En déplaçant Refine color (white-point), nous allons à la fois modifier la teinte vers plus de bleu/vert et la saturation. Bien sûr j'aurais pu faire d'autres choix.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Utiliser Dominant Color - La Seine plus bleue]]&lt;br /&gt;
&lt;br /&gt;
=====Un deuxième exemple - Utiliser la TRC ou Surround - Camionnette sous un tunnel=====&lt;br /&gt;
* Fichier raw (Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Remarquez que les réglages sont simplifiés et intuitifs:&lt;br /&gt;
** Gamma = 2.90 : éclaircit les lumières;&lt;br /&gt;
** Slope = 80 : éclaircit les ombres.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Utiliser TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image avec Scene Conditions - Surround======&lt;br /&gt;
Ici, c'est encore plus simple.&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Utiliser Surround]]&lt;br /&gt;
&lt;br /&gt;
=====Comparaison entre les 2 TRC modules « Abstract Profiles  - AP» et « Source Data Adjustments - SDA » - incidences de Ciecam =====&lt;br /&gt;
Il existe deux outils TRC dans RawTherapee, l'un dans le module &amp;quot;Abstract Profile&amp;quot; dans la gestion des couleurs et l'autre dans le module Ajustements des données sources (SDA) de l'outil Ajustements locaux, apparence des couleurs.&lt;br /&gt;
&lt;br /&gt;
Les modules Profil abstrait et Ajustements des données sources sont presque identiques à l'exception d'une fonction supplémentaire Log encoding, intégrée dans ce dernier, cet outil doit être réservé aux cas extrêmes qui ne peuvent être résolus autrement. En effet, la manière dont ils sont rendus peut être imprévisible et perturbe souvent l'équilibre de la lumière et des couleurs.&lt;br /&gt;
En effet, ils sont basés sur le même concept de base, l’utilisation d’un profil virtuel pour modifier les données. Ils comprennent :&lt;br /&gt;
* Tone Response Curve : Gamma (lumières), Slope (ombres).&lt;br /&gt;
* Dans ce même intitulé sont également présents deux outils complémentaires :&lt;br /&gt;
** Midtones qui permet d’ajuster les tons moyens, &lt;br /&gt;
** Smooth highlights qui permet d’atténuer les lumières élevées, pratiquement celles où Ev &amp;gt; 0 jusque Ev= +12.&lt;br /&gt;
* Primaries &amp;amp; Illuminant qui permet d’ajuster la colorimétrie des images : choix de l’illuminant, des primaires, et action sur la couleur dominante.&lt;br /&gt;
&lt;br /&gt;
======Situation dans le processus (pipe-line)======&lt;br /&gt;
AP et à la fin du processus, juste avant Color Appearance &amp;amp;Lighting.&lt;br /&gt;
SDA (intégré à Local Adjustments – Cam16) est situé juste après la balance des blancs, vers le début du processus.&lt;br /&gt;
Cette différence de situation va amener une différence de comportement vis à vis des ombres et lumières :&lt;br /&gt;
* SDA est situé avant Exposure, avant Auto-matched Tone Curve, avant tous les curseurs et courbes de « Exposure »&lt;br /&gt;
* SDA utilise pour les calculs internes, ceux de Scene conditions, les données RGB après demoisaicing.&lt;br /&gt;
* AP utilise les données RGB, avec les valeurs calculées à son niveau du processus (en fin).&lt;br /&gt;
Il semble évident, selon les réglages ci-dessus réalisés par l’utilisateur et l’action de « Auto-matched Tone curve » dépendante de chaque image et de chaque boîtier, que la répartition des ombres et lumières seront très probablement différentes.&lt;br /&gt;
&lt;br /&gt;
Gamma (lumières) et Slope (ombres) auront un comportement différent : il faudra généralement des réglages plus faibles dans SDA que AP.&lt;br /&gt;
Primaries &amp;amp; illuminants, auront une sensibilité différente, notamment la couleur dominante.&lt;br /&gt;
&lt;br /&gt;
======Influence de Ciecam======&lt;br /&gt;
AP est indépendant du module Ciecam situé derrière lui (Color Appearance &amp;amp; Lighting). Si vous rendez actif « Ciecam » les paramètres du module « AP » seront pris en compte.&lt;br /&gt;
SDA est intégré au module Ciecam de Local Adjustments. Les réglages de SDA sont obligatoirement pris en compte par le modèle d’apparence coloré (CAM).&lt;br /&gt;
&lt;br /&gt;
======Que fait Ciecam ?======&lt;br /&gt;
Nous n’allons pas ici (re)décrire le tutoriel sur Ciecam, mais de manière simplifiée Ciecam, que ce soit dans « Color Apperance &amp;amp; Lighting » ou dans « Local adjustments – Color Appearance Cam16 » : “Trying to take into account by software, the physiological aspects due to the perception of the eye and the brain”. &lt;br /&gt;
&lt;br /&gt;
Vous pouvez avoir une information partielle sur les effets que prend en compte les 2 versions de Ciecam implantées dans RT.&lt;br /&gt;
[[CIECAM02/fr#Introduction_-_historique | Historique - effets pris en compte]]&lt;br /&gt;
&lt;br /&gt;
La prise en compte de la majorité des effets est automatiquement réalisée par le logiciel. C’est particulièrement vrai pour SDA.&lt;br /&gt;
&lt;br /&gt;
L’effet de Stevens est un cas particulier. Il est réalisé par les 2 combobox « surround », avec par exemple dans « Scene conditions » les réglages possibles : Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
La prise en compte de ces effets modifie en profondeur l’image pour la rendre plus proche des conditions de prise de vue et de visionnage. Bien sûr seul celui qui a pris le cliché peut complètement restituer le contexte.&lt;br /&gt;
&lt;br /&gt;
Quelques remarques sur l’incidence de certains effets pris en compte :&lt;br /&gt;
&lt;br /&gt;
* Surround (effet de Stevens) va éclaircir les ombres. Il semble évident que plus Surround aura un effet élevé (exemple  Dark), plus il faudra réduire l’action de la Tone Response Curve – notamment Slope.&lt;br /&gt;
&lt;br /&gt;
* Le contraste simultané, d’autant plus important que les écarts de luminance dans l’image seront grands, sera pris en compte automatiquement  et va augmenter la saturation des couleurs. Ceci revient à dire que les images où il y a un déséquilibre entre les ombres et les lumières - naturel, ou artificiellement obtenu par une inadéquation entre gamma (lumières) et Slope (ombres) - aboutira à une augmentation exagérée de la saturation.&lt;br /&gt;
&lt;br /&gt;
* L’effet de Hunt, sera effectué (si les données Exif sont prises en compte) à partir des valeurs de Absolute Luminance.&lt;br /&gt;
&lt;br /&gt;
Les réglages dans Cam16 Images Adjustments, prennent eux aussi en compte ces effets. Par exemple :&lt;br /&gt;
* Brightness Q (et contrast Q)  s’appuient sur la valeur de Absolute Luminance pour se différencier de Lightness (J) (et Contrast J).&lt;br /&gt;
* Saturation (s), va augmenter la sensation de couleur de manière différentiée : moins d’action dans les ombres, par rapport à Chroma (C).&lt;br /&gt;
&lt;br /&gt;
Donc, en résumé pour SDA :&lt;br /&gt;
* plus vous agissez sur Surround (Scene) plus il faudra réduire les paramètres « Slope » et « Gamma » - par rapport à ceux de AP.&lt;br /&gt;
* la saturation des couleurs sera directement impactée par des choix exagérés. Vous pouvez l’ajuster si nécessaire avec le curseur Saturation (Cma16 Images Adjustments). Le système est sous votre contrôle, il n’y a pas de IA (Intelligence Artificielle).&lt;br /&gt;
* la prise en compte des « effets » a une incidence sur la répartition ombres lumières et sur les couleurs. Il est impossible de transposer les réglages de AP (au moins ceux concernant la luminance : gamma, slope, midtones…) vers SDA et réciproquement, sinon globalement de réduire leurs valeurs.&lt;br /&gt;
&lt;br /&gt;
======Synthèse======&lt;br /&gt;
Ciecam, notamment sous sa dernière évolution Cam16 (2020, 2022) est un outil de très grande qualité (même s’il n’est pas parfait) . Il est le seul à ma connaissance à réunir la quasi totalité des concepts de Modèles d’Apparence Colorés (CAM), ce qui n’est pas le cas d’autres systèmes comme CieLab OKLab, Jzazbz , etc.:&lt;br /&gt;
* Séparation en 3 processus : Scene conditions, Image Adjustments, Viewing conditions ;&lt;br /&gt;
* Présence d’outils et processus pour prendre en compte les aspects physiologiques du couple oeil-cerveau chez l’homme : contraste simultané, surround, adaptation chromatique, etc. ;&lt;br /&gt;
* Utilisation des 6 variables nécessaires à un CAM : lightness (J), brightness (Q), chroma (C), saturation (s), colorfullness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
Il présente toutefois une lacune qui peut être un handicap dans le cas d’images difficiles (à haute dynamique par exemple), l’absence de prise en compte d’une cartographie globale de l’image, car Cam16 travaille pixel par pixel. &lt;br /&gt;
&lt;br /&gt;
Le module SDA, permet partiellement de contourner cette lacune. Il réalise une analyse globale des tonalités et couleurs avec des outils associés (Log encoding, Tone Response Cuve &amp;amp; Midtones…).&lt;br /&gt;
Il est associé partiellement  à Cam16. C’est à dire que les changements induits par SDA seront pris en compte par Cam16, mais sans apporter de jugement sur leur pertinence. Il est possible, selon les images, réglages de SDA, ou des processus en aval (exposure, etc.) que l’image obtenue soit trop contrastée dans certaines zones, ou trop saturées notamment dans les ombres.&lt;br /&gt;
&lt;br /&gt;
Il revient à l’utilisateur d’utiliser les outils présents notamment dans Image Adjustments (saturation, brightness,…) soit sur la totalité de l’image, soit avec l’aide d’un RT-spot supplémentaire sur les zones concernées. De la même façon, le traitement important des ombres amène souvent une montée du bruit, qu’il convient de maîtriser : l’outil Denoise de Blur/Grain &amp;amp; Denoise doit permettre d’y remédier.&lt;br /&gt;
&lt;br /&gt;
====Le module Sigmoid Q &amp;amp; Log encoding Q (obsolète) ====&lt;br /&gt;
* ce module ressemble à celui implanté dans « JzCzHz » : &lt;br /&gt;
** choix entre « Log encoding » ou « Sigmoid »&lt;br /&gt;
** prise en compte ou non de « Black Ev » et « White Ev »&lt;br /&gt;
* mais il apporte un ajout important, celui lié à l'utilisation d'un vrai CAM (ce qui n'est pas le cas de JzCzHz) qui va automatiquement corriger la chromaticité en prenant en compte l'ensemble des paramètres de la « scène » et des « viewings conditions ».&lt;br /&gt;
* l'utilisation est similaire à celle du module JzCzHz, vous pouvez agir sur les paramètres qui auront une incidence évidente sur le rendu&lt;br /&gt;
** Mean luminance (Yb%), Absolute luminance, HDR PQ (Peak Luminance)&lt;br /&gt;
** « Black Ev » et « White Ev », si cette option est choisie&lt;br /&gt;
** Si vous avez choisi « Sigmoid » : « Contrast » agit sur la forme de la sigmoid et en conséquence sur la force, « Threshold » (point gris) distribue l'action en fonction de la luminance, « Blend » agit sur l'aspect final de l'image contraste et luminance.&lt;br /&gt;
&lt;br /&gt;
* Tous les modules qui contrôlent le « Dynamic Range » : Log encoding, Dynamic Range &amp;amp; exposure, Tone mapping, Color Appearance (Cam16 &amp;amp; JzCzHz), du fait qu'ils sont situés après le processus « Highlight reconstruction » (Color Propagation) vont modifier les données « reconstruites ». Lorsque l'utilisation de « Highlight reconstruction » (Color Propagation) est nécessaire, ce qui n'est pas synonyme d'images à forte dynamique, vous devez utiliser soit des « Excluding Spots », soit un masque.&lt;br /&gt;
&lt;br /&gt;
[[File:Cam16-sigmoid.jpg|600px|thumb|center|Sigmoid and Log encoding]]&lt;br /&gt;
&lt;br /&gt;
==='''Tutoriel Ciecam - JzCzHz'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02/fr#Tutoriel_Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29 |Tutoriel - Ciecam - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Le module expérimental JzCzHz'''===&lt;br /&gt;
Pour une présentation de ce module dans Ciecam, suivre ce lien: [[CIECAM02/fr#Jzazbz - Un nouveau CAM ? (Cam16 &amp;amp; JzCzHz)| Jzazbz - un nouveau CAM ? (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
&lt;br /&gt;
====Comprendre les réglages CAM - SDR - HDR - Généralités====&lt;br /&gt;
Voir à ce sujet dans Ciecam:[[CIECAM02/fr#Comprendre les réglages CAM - SDR - HDR - Généralités | Comprendre les réglages CAM - SDR - HDR - Généralités]]&lt;br /&gt;
&lt;br /&gt;
====Comprendre les réglages CAM - SDR - HDR - En pratique - Introduction====&lt;br /&gt;
&lt;br /&gt;
Voir à ce sujet dans Ciecam:[[CIECAM02/fr#Comprendre les réglages CAM - SDR - HDR - Introduction| Comprendre les réglages CAM - SDR - HDR - Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Comprendre - En pratique avec une saisie d'écran=====&lt;br /&gt;
&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
Vous disposez de 6 réglages qui interagissent sur Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; correspond à la valeur moyenne (exprimée en % de gris) de l'image juste après dématricage (demosaicing). Plus le curseur sera à droite, plus le résultat final sera sombre. Ce curseur agit aussi sur la valeur de référence prise en compte par &amp;quot;Log encoding Jz&amp;quot;, cette valeur va changer le contraste apparent de l'image avant la conversion logarithmique.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot; - &amp;quot;La&amp;quot; (décrite plus haut), permet, en corrigeant si nécessaire cette valeur:&lt;br /&gt;
** d'une part d'agir sur la partie commune CAM (Color Appearance Model), pour prendre en compte la vraie valeur utilisée par Jz et Q.&lt;br /&gt;
** d'autre part (mon interprétation) de modifier l'amplitude utile des valeurs de Jz dans le code (qui nous l'avons vu étaient très faibles), par interaction non linéaire avec le curseur &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation). Des valeurs élevées de &amp;quot;La&amp;quot; vont accroitre en internes les valeurs de Jz, dont le rendu n'est pas linéaire du fait de la fonction PQ.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot;, permet d'agir sur les valeurs internes de Jz indépendamment des valeurs de &amp;quot;La&amp;quot;. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. Ce curseur pour lequel je recommande de ne pas y toucher correspond au rapport 8 bits / 10 bits des valeurs de Jz entre les valeurs SDR (100 cd/m2) et HDR (10000 cd/m2 choisis par Dolby). Néanmoins une action est autorisée qui sera (ou non) validée lors de l'usage réel de moniteurs HDR.&lt;br /&gt;
* &amp;quot;PQ - Peak luminance&amp;quot;, traduit la valeur du &amp;quot;Peak luminance&amp;quot;, utilisée en interne par la fonction PQ. Cette valeur utilisée en interne pour l’ensemble des calculs HDR en amont du moniteur est à différencier de celle qui pourra être allouée au moniteur (lorsque ces fonctionnalités seront disponibles...avec le moniteur assorti...). Essayez d'agir sur PQ, vous verrez une variation des ombres et des lumières, ainsi que de la saturation.&lt;br /&gt;
* ces 3 derniers réglages - &amp;quot;Jz remapping&amp;quot; - permettent une meilleure adaptation des valeurs internes de Jz. Pour que les courbes, sliders, outils réagissent correctement, une deuxième correction est appliquée uniquement au niveau de ces outils pour mettre Jz dans l'intervalle [0..1].&lt;br /&gt;
* &amp;quot;Surround&amp;quot; (Average, Dim, Dark), prend en compte les conditions de l'environnement lors de la prise de vue. Est-ce que le fond, autour de la scène, était normal, un peu sombre, ou très sombre. Agir sur ce réglage va changer l'apparence de l’image en l’éclaircissant progressivement.&lt;br /&gt;
* Essayez d'agir sur ces 6 réglages. Attention, certains ont un effet que si un réglage Jz est en cours (Log encoding, Sigmoid Jz, JzczHz adjustments)&lt;br /&gt;
* Vous pouvez visualiser l'incidence de ces réglages dans la console, par exemple;&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Où : &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; est le multiplicateur appliqué à Jz, pour le traitement à proprement parler,&lt;br /&gt;
* &amp;quot;to_one&amp;quot; est le deuxième multiplicateur permettant aux courbes, fonctions de travailler dans un intervalle habituel [0..1]&lt;br /&gt;
&lt;br /&gt;
====Un outil HDR - Sigmoid Jz (et Log encoding Jz)====&lt;br /&gt;
La version de &amp;quot;Log encoding Jz&amp;quot; est proche dans son concept de celle du module &amp;quot;Log encoding&amp;quot;. La principale différence tient à l’évaluation de la luminance qui dans le module &amp;quot;Log encoding&amp;quot; est calculée en mode RGB, avec les éventuelles conséquence sur des dérives de teinte (hue) si cette évaluation n'est pas parfaite.&lt;br /&gt;
&lt;br /&gt;
Dans le cas de &amp;quot;Log encoding Jz&amp;quot; la luminance utilisée est Jz qui se comporte comme un CAM et dans ce sens les seules variations de teintes sont celles voulues par les chercheurs au niveau des matrices de conversion. Les évaluations menées sur Jz amènent des résultats proches de Cam16, c'est à dire très bons, donc sans dérive de couleurs.&lt;br /&gt;
&lt;br /&gt;
D'autres différences qui résultent du choix de Jz comme guide de la luminance (au lieu de RGB) sont au niveau de la prise en compte des valeurs de &amp;quot;Mean luminance (Yb%)&amp;quot; et &amp;quot;Viewing luminance (Yb%)&amp;quot; qui tiennent compte des particularités de Jz dans le calcul des 2 points gris.&lt;br /&gt;
&lt;br /&gt;
Pour &amp;quot;Log encoding Jz&amp;quot; et de &amp;quot;Sigmoid Jz&amp;quot; un calcul - à partir des données de l’image juste après dématricage (demosaicing) - évalue les valeurs de: a) &amp;quot;Black Ev&amp;quot; (point le plus sombre de l'image), b) White Ev (point le plus clair de l'image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* Ces valeurs sont utilisées en mode logarithmique, la luminance &amp;quot;Jz&amp;quot; devient &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot; &lt;br /&gt;
* Pour &amp;quot;Log encoding Jz&amp;quot; une solution unique à l'équation logarithmique - afin de (re)mettre les valeurs en linéaire - est calculée à partir des valeurs de a), b) et &amp;quot;Viewing mean luminance (Yb%)&amp;quot; - la valeur de c) influant la répartition du contraste, sans interférer sur le calcul. Nous verrons qu'il en va différemment avec &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* Rappel des principes de Sigmoid Jz [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principes]]&lt;br /&gt;
* Fichier raw (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Comme il a été évoqué précédemment, faire rentrer une image HDR - ici 14.8 Ev et une luminance absolue de 2000 cd/m2 - dans les caractéristiques d'un moniteur SDR (7 Ev, 120 cd/m2) relève de mission impossible, sans compromis.&lt;br /&gt;
Que ce soit &amp;quot;Log encoding Jz&amp;quot; ou &amp;quot;Sigmoid Jz&amp;quot; la teinte est préservée, mais les réglages de répartition de la luminance entre les ombres les plus profondes, les hautes lumières et les tons moyens vont dépendre de l'utilisateur et des choix qu'il réalise.&lt;br /&gt;
Pour &amp;quot;Log encoding Jz&amp;quot; - &amp;quot;Mean luminance (Yb%)&amp;quot; a une très forte incidence sur le résultat, en modifiant le contraste. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; va lui agir sur la luminance globale de l’image. Les 2 autres réglages &amp;quot;Black Ev&amp;quot; et &amp;quot;White Ev&amp;quot; - qui dépendent d'une échelle logarithmique vont comme &amp;quot;Mean luminance (Yb%)&amp;quot; agir sur la répartition entre les ombres et les lumières. Il est évident que les réponses et donc les réglages sont dépendants de l'image, du moniteur, et des 6 réglages vus précédemment - pour ces 3 réglages il y a une solution unique pour &amp;quot;rendre linéaire&amp;quot; la conversion logarithmique.&lt;br /&gt;
&lt;br /&gt;
Pour &amp;quot;Sigmoid Jz&amp;quot;:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; aura une incidence plus faible que pour &amp;quot;Log encoding Jz&amp;quot;, car il n'agit pas dans les calculs de &amp;quot;Sigmoid&amp;quot;&lt;br /&gt;
* &amp;quot;Black Ev&amp;quot; et &amp;quot;White Ev&amp;quot; auront le même comportement de principe que pour &amp;quot;Log encoding Jz&amp;quot;. Selon les images les ajustements de &amp;quot;Black Ev&amp;quot; et &amp;quot;White Ev&amp;quot; pourront être différents entre &amp;quot;Log encoding Jz&amp;quot; et &amp;quot;Sigmoid Jz&amp;quot;. Par exemple &amp;quot;White Ev&amp;quot; pourra être augmenté afin d'assurer un meilleur rendu des hautes lumières, améliorer le contraste et la saturation. &lt;br /&gt;
&lt;br /&gt;
La différence est principalement dans l'utilisation des 2 curseurs &amp;quot;Contrast&amp;quot; et &amp;quot;Threshold (gray point)&amp;quot;. &lt;br /&gt;
* &amp;quot;Contrast&amp;quot; agit sur la pente de la Sigmoid, plus &amp;quot;Contrast&amp;quot; est élevé (supérieur à 0.5) plus la fonction exponentielle sera plate, plus les écarts entre &amp;quot;ombres&amp;quot; et &amp;quot;lumières&amp;quot; seront faibles. Il est préférable d'utiliser les valeurs inférieures à 0.5 et d'ajuster ensuite &amp;quot;Threshold&amp;quot;. &lt;br /&gt;
* &amp;quot;Threshold&amp;quot; va déplacer le point d'équilibre (un peu à la manière de &amp;quot;Mean luminance (Yb%) pour Log encoding Jz), en privilégiant soit les ombres - déplacer le curseur à gauche va éclaircir les ombres avec un impact faible sur les lumières et réciproquement. &lt;br /&gt;
* C'est la fonction exponentielle qui &amp;quot;résout l'équation&amp;quot; qui convertit les données logarithmiques en données linéaaires (Black Ev, White Ev, et Jz mis en logarithme base 2). C'est donc l'utilisateur qui &amp;quot;résout&amp;quot; l'équation. &lt;br /&gt;
* A noter de ce fait, qu'il n'y a pas &amp;quot;une&amp;quot; solution mais plusieurs.&lt;br /&gt;
* La fonction &amp;quot;blend&amp;quot; agit - un peu comme &amp;quot;Viewing mean luminance (Yb%)&amp;quot; - sur la luminance globale de l'image et n'a pas d'incidences sur les calculs de la Sigmoid.&lt;br /&gt;
&lt;br /&gt;
Les réglages par défaut (Contrast = 0.5, Threshold = 1, Blend = 1) doivent convenir, avec de faibles variations autour de ces valeurs, notamment pour &amp;quot;Contrast&amp;quot;, en première approche pour une majorité d'images. Probablement les réglages satisfaisants sont un peu plus longs à trouver avec &amp;quot;Sigmoid Jz&amp;quot; par rapport à &amp;quot;Log encoding Jz&amp;quot;, mais ils sont pluriels.&lt;br /&gt;
&lt;br /&gt;
Mais (rappel) le réglage fin de l'image (répartition du contraste et de la luminance) va dépendre (comme dans le cas de log encoding Jz) des caractéristiques de l'image, de celle du moniteur et de celles des 6 réglages de &amp;quot;Scene conditions Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Ajustements des réglages &amp;quot;Log encoding Jz&amp;quot; et &amp;quot;Sigmoid Jz&amp;quot;'''&lt;br /&gt;
* Comme évoqué précédemment les calculs automatiques de &amp;quot;Log encoding Jz&amp;quot; ou les réglages (plus souples) de &amp;quot;Sigmoid Jz&amp;quot; doivent être complétés pour arriver à un bon résultat, par les réglages disponibles dans &amp;quot;Jz Cz Hz Images adjustments&amp;quot;:&lt;br /&gt;
** action sur Brightness et Contrast pour affiner la répartition de la luminance, notamment le contraste.&lt;br /&gt;
** saturation (ou chroma) et les courbes Cz(C), Cz(J) pour amener la chromaticité aux valeurs souhaitées (celles ci auront généralement été réduites du fait des changements importants de luminance).&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch'''===&lt;br /&gt;
&lt;br /&gt;
== Principes généraux ==&lt;br /&gt;
===L'Objet RT-spot===&lt;br /&gt;
&lt;br /&gt;
Comme je l'ai évoqué, le système utilisé est proche de celui mis au point par Nik Software, avec de grandes différences:&lt;br /&gt;
* chaque RT-spot, peut être considéré comme un objet qui comporte plusieurs champs : Il y a environ 640 &amp;quot;events&amp;quot; gérés, dont environ 160 seulement pour le mode &amp;quot;basic&amp;quot;. Ils sont constitués de curseurs, courbes, combobox, checkbox, expanders, mask, etc.;&lt;br /&gt;
* chaque champ, organisé en groupes, peut être ou non activé, et peut avoir des valeurs variables selon sa nature ;&lt;br /&gt;
* les groupes sont des ensembles cohérents pour l'utilisateur : Color &amp;amp; Light, Shadows Highlight &amp;amp; Tone equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask,  Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels; Voir tutoriel Ciecam pour le module Color apperance (Cam16 &amp;amp; JzCzHz) [[CIECAM02/fr#Tutoriel_Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29 |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
&lt;br /&gt;
* chaque RT-spot, crée une &amp;quot;couche&amp;quot; supplémentaire qui peut être assimilée à un calque. Chaque Rt-spot ajouté travaille par transparence et laisse voir les modifications précédentes - &amp;quot;Excluding Spot&amp;quot; permet d'accéder à l'image originale (zone à exclure, ou simuler un mode inverse). &lt;br /&gt;
* l'ensemble des RT-spots fonctionne en mode L*a*b* - contrairement au mode pleine image qui est soit en mode &amp;quot;RGB&amp;quot; avant demosaicing, soit en mode &amp;quot;rgb&amp;quot;, soit en mode L*a*b*&lt;br /&gt;
** évidemment vous allez me dire &amp;quot;mais le mode L*a*b* pose de nombreux problèmes, il est limité à 7Ev&amp;quot; (c'est vrai pour les profils ICC de sortie vers le moniteur codés en 8 bits), &amp;quot;il ne respecte pas les couleurs&amp;quot; (c'est vrai, si il n'y a pas de corrections - dérive dans les bleus-pourpres, et les rouges-orangés), etc.&lt;br /&gt;
** dans une majorité de cas, lorsqu'on utilise L*a*b* avec des réels (32 bits) et la correction Munsell de Rawtherapee (qui corrige les dérives de couleurs), seule la partie très hautes lumières (en HDR) va poser problème. L*a*b* passe largement plus de 15Ev (mes essais, sur des images à forte dynamique...). Mais qui possède un équipement HDR ? Le module JzCzHz est une première approche HDR.&lt;br /&gt;
** pour plus d'informations allez dans &amp;quot;Succession des outils dans le pipeline - Colorimétrie&amp;quot; [[Toolchain Pipeline/fr|Succession des outils dans le pipeline - Colorimétrie générale]]&lt;br /&gt;
* les &amp;quot;RT-spots objets&amp;quot; sont gérés - création, modification, suivi - dans une boucle &amp;quot;for&amp;quot;;&lt;br /&gt;
* il n'y a pas de duplication de code. Par exemple le module &amp;quot;Denoise&amp;quot; de &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, utilise les fonctions du module &amp;quot;main&amp;quot;, qu'il a bien sûr fallu adapter pour élever le niveaux de décomposition en ondelettes. Il en est de même de &amp;quot;Retinex&amp;quot;, etc. Par contre certains modules ont un code différents de &amp;quot;main&amp;quot; par exemple &amp;quot;Color &amp;amp; Light&amp;quot;, etc.&lt;br /&gt;
* Beaucoup d'outils de &amp;quot;Local adjustments&amp;quot; sont semblables à ceux de &amp;quot;main&amp;quot;, mais il y a des fonctions supplémentaires, comme par exemple : &amp;quot;Tone Equalizer&amp;quot; ou &amp;quot;Tone Response Curve (TRC)&amp;quot; (avec Shadows/Highlights) qui permet un ajustement fin et différencié de l'exposition, &amp;quot;Original Retinex&amp;quot; qui permet un &amp;quot;dodge and burn&amp;quot;, &amp;quot;Log encoding&amp;quot; qui est une sorte de &amp;quot;Tone mapping&amp;quot; utilisant un codage logarithmique simple, &amp;quot;Warm/cool&amp;quot; (Vibrance &amp;amp; Warm/Cool) qui permet une simulation de changement de température, comme dans &amp;quot;White Balance&amp;quot;, &amp;quot;Blur/grain&amp;quot; (Blur/Grain &amp;amp; Denoise) permet des flous locaux ou des ajouts de simulation de grain ou de bruit, JzCzHz et CAM16 avec Sigmoid et autres avancées (Color Appearance(Cam16 &amp;amp; JzCzHz)) qui autorisent une ouverture vers des fonctions HDR, Wavelets avec de nombreux nouveaux outils (tone mapping ou décompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===La délimitation des zones - l’aperçu de la zone RT-spot===&lt;br /&gt;
Lorsque l’utilisateur sélectionne un RT-spot (spot de contrôle),l’image à l’écran montre:&lt;br /&gt;
* un centre &amp;quot;C&amp;quot;, constitué d'un cercle dont on peut faire varier : a) le diamètre, b) la position avec la souris ou les curseurs;&lt;br /&gt;
* quatre &amp;quot;points délimiteurs&amp;quot; horizontaux ou verticaux (&amp;quot;T&amp;quot; top, &amp;quot;B&amp;quot; bottom, &amp;quot;L&amp;quot; left, &amp;quot;R&amp;quot; right) dont on peut faire varier les positions avec la souris ou les curseurs.&lt;br /&gt;
&lt;br /&gt;
On aboutit à :&lt;br /&gt;
* une zone globale (ellipse, rectangle) délimitée par les 4 &amp;quot;points délimiteurs&amp;quot; (&amp;quot;T&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;L&amp;quot;, &amp;quot;R&amp;quot;): cette zone est celle où sont opérés les calculs des différents algorithmes (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.). C'est à l'intérieur de celle-ci (sauf bien sûr en mode inverse) que sont calculés et appliqués les algorithmes de détection de couleur et de structure.&lt;br /&gt;
* 4 zones (à l'intérieur de la zone globale - les 4 parties de l'ellipse ou du rectangle), dont on ne peut pas faire varier l'orientation; ces 4 zones ont chacun de leurs sommets reliés par une ellipse imaginaire ou un rectangle (settings). &lt;br /&gt;
&lt;br /&gt;
Il est possible de pointer les limites des zones en dehors de la zone &amp;quot;preview&amp;quot;. Ce qui est toujours le cas en mode &amp;quot;full image&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A noter que l'utilisation de un ou plusieurs masques (avec 1 ou 2 Spots), peut suppléer à certaines fonctionnalités manquantes ou être un &amp;quot;plus&amp;quot; dans le traitement (surtout selon les habitudes de chacun).&lt;br /&gt;
&lt;br /&gt;
De même vous ne pouvez pas faire pivoter le Rt-spot, car cela pose 2 problèmes : le premier de GUI qui ne semble pas insurmontable (si quelqu'un de compétent souhaite le faire); le second, plus complexe est la modification de l'algorithme de calcul...&lt;br /&gt;
&lt;br /&gt;
===Les 3 types de gradient===&lt;br /&gt;
L'objet RT-spot est conçu sur le principe de 3 gradients:&lt;br /&gt;
* gradient du à la dissymétrie possible. En plaçant le centre du spot dans un angle du Spot et en faisant varier hauteur et largeur on crée naturellement un gradient différentiel avec les 3 gradients suivants :&lt;br /&gt;
* gradient du à la transition - réglable - du centre vers la périphérie du Spot : 3 sliders permettent une variation différentielle.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot; : jusque la valeur choisie &amp;quot;x&amp;quot; - l'algorithme est appliqué à 100% du centre jusque &amp;quot;x%&amp;quot; de la zone sélectionnée, puis une décroissance est assurée jusque 0, pour atteindre la périphérie du Spot. Avec cette transition on aboutit à 3 zones (à noter que en mode inverse, ces 3 zones sont inversées !):&lt;br /&gt;
*** zone 0 : celle située à l'extérieur du rectangle/ellipse de sélection et donc à l'extérieur des 4 courbes aucune action.&lt;br /&gt;
*** zone 1 : celle située à l'intérieur des 4 courbes où est prise en compte l'action des curseurs &amp;quot;transition&amp;quot; : action progressive.&lt;br /&gt;
*** zone 2 : celle située à l'intérieur des 4 courbes, proche du centre &amp;quot;C&amp;quot;, où n'est pas prise en compte l'action des curseurs &amp;quot;transition&amp;quot; : action complète.&lt;br /&gt;
** &amp;quot;Transition decay (linear - log)&amp;quot; : fait varier l'intensité géographique de la transition décroissante:  1 loi linéaire - à partir de 2 loi parabolique - à partir de 3 jusque 10, loi cubique transition à très forte décroissance (jusque puissance 25).&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot; : Si le slider est différent de zéro, crée un gradient différentiel entre l'abscisse et l'ordonnée. Les valeurs négatives réduisent la zone de transition en ordonnée, et l'inverse pour les valeurs positives.&lt;br /&gt;
** &amp;quot;Feather gradient (Grad. Filters) : utilisé uniquement par les &amp;quot;Graduated filters, lorsqu'ils sont présents dans certains outils. Agit par pourcentage de la diagonale du RT-spot &lt;br /&gt;
* gradient de couleur (en fait de deltaE) grâce à la fonction &amp;quot;Scope&amp;quot; (étendue) - cette fonction prend en compte le deltaE. Plus les valeurs sont faibles, moins les écarts de couleur (L, C, H) sont pris en compte, à partir de Scope=80, l'étendue augmente pour à 100 atteindre une action égale quelque soient les couleurs. 3 sliders permettent de faire varier le gradient. &lt;br /&gt;
** &amp;quot;deltaE decay&amp;quot; : intensité de l'action en fonction du deltaE - 1 linéaire - jusque 10 à très forte décroissance (puissance 10). Les hautes valeurs sont plutôt réservées aux images à très large gamut.&lt;br /&gt;
** &amp;quot;DeltaE-scope threshold&amp;quot; : interagit sur les valeurs de deltaE prises en compte et &amp;quot;scope&amp;quot; - réduit ou accroît la sensibilité - à utiliser selon l'image. Les images à fort gamut (fleurs, couleurs artificielles..) supportent des valeurs élevées de ce slider.&lt;br /&gt;
** &amp;quot;ab-L balance deltaE&amp;quot; : Pour une valeur de 1, le calcul du deltaE prend en compte de manière égale les 3 composantes L* , a* , b*. Les valeurs supérieures vont accroître l'action de L* et réciproquement&lt;br /&gt;
** &amp;quot;C-H balance deltaE&amp;quot;: pour une valeur de 1, le calcul du deltaE  prend compte à part égales, la chromaticité et la teinte, les valeurs supérieures vont accroître l'action de H (hue) et réciproquement.&lt;br /&gt;
** &amp;quot;DeltaE preview color - intensity&amp;quot;: par défaut la couleur est verte. Si vous utilisez des valeurs négatives, la couleur sera bleue. Plus la valeur sera élevée plus la couleur aura une forte intensité &lt;br /&gt;
&lt;br /&gt;
Ainsi, tous les modules (y compris Contrast By Detail Levels, Retinex, Tone Mapping, etc.), ainsi que les modules agissant principalement sur la luminance (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows Highlight &amp;amp; Tone Equalizer, ...) réalisent de fait des gradients, croissants ou décroissants. Le centre du Spot étant toujours le point de référence.&lt;br /&gt;
&lt;br /&gt;
===Les 3 types de RT-spot=== &lt;br /&gt;
Trois types de RT-spot sont proposés:&lt;br /&gt;
* Normal spot: chaque nouveau spot prend en compte les réglages des précédents - si bien sûr ils sont dans la zone d'action commune - on peut parler d'action récursive (d'une certaine manière cela s'apparente un peu à des calques superposés).&lt;br /&gt;
* Excluding spot: chaque nouveau spot réinitialise, l'image à partir des données originales, mais garde pour les calculs, les références de l'image modifiée par les autres RT-spots. Il permet d'annuler dans la zone sélectionné par Excluding Spot, l'action du Normal Spot. Peut également servir à réaliser le mode &amp;quot;inverse&amp;quot; de certains outils.&lt;br /&gt;
* Full image :&lt;br /&gt;
** vous permet de travailler sur l'image entière, de la même manière que les outils de &amp;quot;main&amp;quot;, mais en prenant en compte le deltaE. Ce qui est un net avantage (si vous ne souhaitez pas en bénéficier régler le Scope des outils à 100... &lt;br /&gt;
** Les délimiteurs du RT-spot (rectangle) sont placés nettement au delà des limites de l'image, vous pouvez les changer, si vous le souhaitez par exemple si vous changez la transition par défaut (100) pour obtenir l'effet souhaité. &lt;br /&gt;
** La transition est réglée sur 100. Vous pouvez la changer, notamment pour créer des gradients.&lt;br /&gt;
** Du fait de l'utilisation du deltaE, le rendu de l'image dépendra de la position du centre du Rt-spot (comme les 2 autres types). C'est la position du centre du Rt-spot, et sa taille qui détermine les paramètres de base de calcul du deltaE. &lt;br /&gt;
** Attention avec certains modules, par exemple dans &amp;quot;denoise&amp;quot; (Blur/Grain &amp;amp; Denoise&amp;quot;, &amp;quot;wavelet&amp;quot; (Local contrast &amp;amp; Wavelets ou &amp;quot;Retinex&amp;quot; (Dehaze &amp;amp; Retinex), la quantité de mémoire requise peut être nettement supérieure à 8M°, voire 16M°, selon la taille des images. De plus FFTW (lorsqu'on l'utilise) risque d'accroître les temps de traitement.. &lt;br /&gt;
&lt;br /&gt;
Dans les trois cas, vous avez accès à la quasi totalité des réglages pour tous les outils.  &lt;br /&gt;
&lt;br /&gt;
====Commentaires sur le &amp;quot;Excluding spot&amp;quot;:====&lt;br /&gt;
* il est dans le principe assez similaire au &amp;quot;Contre point&amp;quot; de Capture NX2(c) et permet de défaire des actions trop invasives par exemple une &amp;quot;bavure&amp;quot; non désirée, ou d'empêcher l'action sur une partie déterminée, par exemple si l'utilisateur souhaite accroître la saturation d'un portrait et qu'il veut exclure l’œil ou une partie avec une exposition différente. &lt;br /&gt;
* l'algorithme que j'ai utilisé est très proche de ceux présents jusqu'ici dans &amp;quot;local adjustements&amp;quot;, il est fondé sur les différences de deltaE et aussi sur la structure de l'image (via une transformée de Sobel Canny). Il n'est pas &amp;quot;parfait&amp;quot; mais devrait satisfaire 70% des cas.&lt;br /&gt;
* il permet de simuler un module &amp;quot;inverse&amp;quot;, pour cela: créez un Rt-spot qui dépasse les limites de l'image, appliquez le, à l'outil souhaité en mode &amp;quot;Normal spot&amp;quot; ou &amp;quot;Full image&amp;quot; , puis positionnez un second Rt-psot où vous souhaitez revenir sans modifications, choisissez &amp;quot;Excluding Spot&amp;quot;, agissez sur Scope si nécessaire. Bien sûr vous pouvez avec ce RT-spot &amp;quot;excluding&amp;quot; apporter les modifications à tous les outils (Color &amp;amp; Light, etc.).&lt;br /&gt;
&lt;br /&gt;
====Comment se servir de &amp;quot;Excluding spot&amp;quot;====&lt;br /&gt;
# il suffit de placer le nouveau spot sur la zone à exclure.&lt;br /&gt;
# choisir dans le menu &amp;quot;Settings&amp;quot;, Spot method = &amp;quot;Excluding spot&amp;quot;.&lt;br /&gt;
# Puis régler &amp;quot;Scope&amp;quot;, &amp;quot;Transition&amp;quot;, &amp;quot;Spot size&amp;quot; ainsi bien sûr que 4 limiteurs de zone, pour obtenir les effets désirés. Vous pouvez utiliser si nécessaire, des réglages complémentaires (comme pour le spot normal) par exemple &amp;quot;Color &amp;amp; Light&amp;quot;, etc.)&lt;br /&gt;
# dans certains cas (faible différence de deltaE...) il peut être nécessaire d'ajuster le curseur &amp;quot;Threshold deltaE-scope&amp;quot; - notamment en réduisant la valeur par défaut.&lt;br /&gt;
# dans le cas de zones avec aplat, vous pouvez utiliser &amp;quot;Spot structure&amp;quot; (lorsque ce slider est présent dans un outil)  qui pourra aider dans certains cas à une meilleure délimitation de l'action.&lt;br /&gt;
&lt;br /&gt;
=== Les trois niveaux de complexité===&lt;br /&gt;
Chaque outils (Color &amp;amp; Light, Tone mapping, etc.), est doté d'un sélecteur de niveau de complexité avec 3 cas possibles : Basic, Standard, Advanced&lt;br /&gt;
* &amp;quot;Basic&amp;quot; est le mode par défaut, il permet dans une majorité de cas les problèmes courants, il n'est pas doté de masques et rarement de courbes.&lt;br /&gt;
* &amp;quot;Standard&amp;quot;, est enrichi de fonctions supplémentaires quelques réglages complémentaires, par exemple des &amp;quot;Graduated filters&amp;quot;, ou des courbes,  ainsi que  de masques simplifiés.&lt;br /&gt;
* &amp;quot;Advanced&amp;quot; est le mode le plus complet, il comprend des fonctions avancées nécessitant des utilisateurs expérimentés, par exemple:&lt;br /&gt;
** Color &amp;amp; Light, dispose d'un module &amp;quot;Merge file&amp;quot; qui permet comme Photoshop des mélanges de &amp;quot;calques&amp;quot; (en fait ce sont des Rt-spots) comme les modes : Difference, Multiply, Soft Light, Overlay, etc. &lt;br /&gt;
** Masques : des fonctions complètes plus avancées, comme &amp;quot;Structure Mask&amp;quot;, &amp;quot;Blur Mask&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
Une exception toutefois : Dehaze &amp;amp; Retinex - les options disponibles en &amp;quot;Basic&amp;quot; et &amp;quot;Standard&amp;quot; sont identiques, il faudrait réduire le choix à &amp;quot;Basic&amp;quot; et &amp;quot;Advanced&amp;quot;, mais la modification du GUI semble très complexe...&lt;br /&gt;
&lt;br /&gt;
===Les références teinte, chroma, luminance et le principe de l'algorithme===&lt;br /&gt;
Afin de mettre en œuvre un algorithme performant de détection de forme :&lt;br /&gt;
* la zone du cercle central, sert de référence. En fonction du diamètre choisi par l'utilisateur, le système calcule, la moyenne de la teinte (hue), de la chroma, et de la luminance (lors de l'utilisation de Denoise, ces différentes valeurs sont calculées après un léger flou pour réduire l'impact du bruit);&lt;br /&gt;
* le choix du diamètre de la zone centrale dépend de l'usage. Par exemple pour un feuillage, l'utilisateur aura intérêt à choisir une valeur faible afin de ne sélectionner que le vert du feuillage; à l'inverse pour la peau l'utilisateur aura intérêt  à accroître le diamètre afin d'éviter les prises en compte de données parasites (bruit, cils, etc.);&lt;br /&gt;
* pour chaque quart (de l'ellipse ou du rectangle), et en fonction du curseur &amp;quot;scope&amp;quot;, le système prend en compte :&lt;br /&gt;
# en premier lieu de l'écart de deltaE (différence perçue entre 2 couleurs prenant en compte, la teinte, la chroma et la luminance) entre la zone centrale et le pixel courant;&lt;br /&gt;
# puis, un algorithme s'appuyant sur ce deltaE , atténue l'action en fonction de l'écart de deltaE entre la zone centrale et le pixel courant;&lt;br /&gt;
# la modification d'action utilise soit une loi linéaire, soit une loi de type puissance (parabolique, cubique,....) en fonction du réglage de &amp;quot;DeltaE decay&amp;quot; dans Settings (1 conduit à une loi linéaire, 2 parabolique, etc.).&lt;br /&gt;
&lt;br /&gt;
Ceci va permettre de différencier l'action selon les critères énoncés ci-dessus, comme par exemple, si le cercle central se trouve dans un feuillage, de limiter l'action à l'ensemble du feuillage sans toucher à l'arrière plan, par exemple le ciel (ce qui est impossible avec un lasso). De plus si un autre feuillage se situe dans la zone couverte, celui-ci sera également concernés par la modification.&lt;br /&gt;
&lt;br /&gt;
* l'action sur le curseur transition va permettre de faire varier l'action : si le curseur est réglé sur 50, la moitié (linéaire) de la zone concernée verra une application à 100% de l'effet, puis une transition agira régressivement jusqu'aux limites de la zone. Cette régression est par défaut &amp;quot;linéaire&amp;quot;; vous pouvez changer pour une régression parabolique ou une autre puissance, en agissant sur &amp;quot;transition decay&amp;quot;;&lt;br /&gt;
* si on accroît la valeur de &amp;quot;scope&amp;quot;, progressivement l’ensemble de la zone sélectionnée est prise en compte quelque soit la couleur, la chroma et la luminance; &lt;br /&gt;
* si on réduit la valeur de &amp;quot;scope&amp;quot;, l'action se limitera aux pixels très proches (en termes de deltaE) de la zone de référence;&lt;br /&gt;
* si scope est supérieur à 80, progressivement l'ensemble de la zone est concernée de manière identique (pas du tout de prise en compte du deltaE). Ce mode de travail doit rester exceptionnel et n'est en général pas recommandé sauf par exemple pour créer des gradients de luminance.&lt;br /&gt;
&lt;br /&gt;
L'algorithme de détection de forme est opérationnel en mode &amp;quot;normal&amp;quot; - son implantation en mode inverse s'accompagne de restrictions.&lt;br /&gt;
&lt;br /&gt;
Au dessus de la valeur de &amp;quot;scope&amp;quot; choisie, l'algorithme &amp;quot;deltaE&amp;quot; n'est pas pris en compte (voir ci-après).&lt;br /&gt;
&lt;br /&gt;
====Mise à jour récursive des références====&lt;br /&gt;
Si vous activez la case à cocher &amp;quot;Recursives references&amp;quot;&lt;br /&gt;
* les références  hue (teinte) chroma, luma (luminance) et Sobel seront dynamiquement mises à jour, d'une part entre chaque module utilisé pour un même RT-spot, et d'autre part pour chaque RT-spot;&lt;br /&gt;
* les références qui apparaissent dans les masques C(C), L(L) et LC(H) et h(H) seront elles aussi mise à jour.&lt;br /&gt;
&lt;br /&gt;
====Prévisualisation des zones sélectionnées Preview ΔE (deltaE) ====&lt;br /&gt;
Dans &amp;quot;Settings&amp;quot;, si vous sélectionnez le bouton &amp;quot;Preview ΔE&amp;quot;, vous aurez un aperçu des zones de l'image affectée par la sélection - les transitions ne sont pas prises en compte.&lt;br /&gt;
&lt;br /&gt;
Egalement dans &amp;quot;settings&amp;quot; &amp;quot;Color preview ΔE and intensity&amp;quot; permet:&lt;br /&gt;
* la sélection de la couleur de prévisualisation - bleu ou vert - et son intensité&lt;br /&gt;
&lt;br /&gt;
Les curseurs et courbes agissant sur la couleur sont sans effet avec cette sélection.&lt;br /&gt;
Les curseurs et courbes agissant sur la luminance ont un effet avec cette sélection.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Scope&amp;quot; est le réglage le plus sensible puisque il agit directement sur le deltaE.&lt;br /&gt;
Attention, le réglage de Scope situé dans &amp;quot;Settings&amp;quot; n'est actif que sur sur les outils &amp;quot;Color &amp;amp; Light&amp;quot;, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;, &amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot;. Tous les autres outils ont un réglage Scope spécifique. &lt;br /&gt;
&lt;br /&gt;
Les 4 curseurs situés en &amp;quot;Settings&amp;quot;: a) Threshold ΔE-scope, b) ΔE decay, c) Balance ΔE ab-L, d) Balance  ΔE C-H,  ont également un effet avec cette sélection.&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire - détection de structure ===&lt;br /&gt;
L'algorithme de Sobel-Canny permet en association avec le filtre &amp;quot;Guide Filter&amp;quot; qui lisse les irrégularités, d'utiliser la différence entre la référence (cercle central) et la valeur de la structure en chaque point de l'image.&lt;br /&gt;
&lt;br /&gt;
Cet &amp;quot;écart&amp;quot; est ajouté au calcul de deltaE pour mieux déterminer les contours et les zones à réduire l'effet.&lt;br /&gt;
Ce système est efficace, si: &lt;br /&gt;
* la référence est dans une zone avec une assez importante structure &lt;br /&gt;
* la zone à affaiblir est un aplat ou avec une structure faible.&lt;br /&gt;
&lt;br /&gt;
Structure est implanté dans &amp;quot;Color &amp;amp; Light&amp;quot; et &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot; ainsi que dans &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
Dans le sens Aplats vers structure vous pouvez agir si nécessaire, sur &amp;quot;Threshold structure&amp;quot; (Settings), la valeur est fonction du niveau de bruit.&lt;br /&gt;
&lt;br /&gt;
Il est possible d'utiliser &amp;quot;structure&amp;quot; lorsque :&lt;br /&gt;
# les différences de deltaE sont très faibles et qu'on souhaite une différenciation&lt;br /&gt;
# et lorsque que se trouve accolée une zone avec structure et une autre avec aplats&lt;br /&gt;
&lt;br /&gt;
===Synthèse des différentes options de settings===&lt;br /&gt;
Settings reprend tout ce qui est commun à la gestion des RT-spot, par exemple :&lt;br /&gt;
* les transitions seront identiques quelque soit l'outil choisi (Color and Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise...)&lt;br /&gt;
* mais ce qui n'est pas commun sera traité spécifiquement dans chaque outil, comme par exemple la gestion du deltaE (Scope) pour les outils autres que &amp;quot;Color &amp;amp; Light&amp;quot;,&amp;quot;Shadows Highlight &amp;amp; Tone Equalizer&amp;quot;, &amp;quot;Vibrance &amp;amp; Warm/cool&amp;quot;.&lt;br /&gt;
* remarque : des outils comme: &lt;br /&gt;
** le choix de travailler avec la souris ou avec des sliders (présents dans les versions de développement) a été caché pour simplifier l'interface (il est facile de le réactiver si nécessaire)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Gestion des RT-spots====&lt;br /&gt;
Les premières lignes de l'interface permettent la gestion des RT-spot&lt;br /&gt;
* création (add)&lt;br /&gt;
* Suppression (delete)&lt;br /&gt;
* Duplicate - créer un nouveau spot avec les caractéristiques de l'ancien en termes de forme&lt;br /&gt;
* Rename (renomme le nom du Spot pour personnaliser le suivi)&lt;br /&gt;
* Show - Hide : permet de cacher le Rt-spot pour assurer une meilleure lisibilité.&lt;br /&gt;
&lt;br /&gt;
====Forme du RT-spot====&lt;br /&gt;
Permet de choisir entre ellipse et rectangle comme forme du Rt-spot.&lt;br /&gt;
A noter que dans une majorité de cas, ce choix est avec très peu d'incidences sur les résultats.&lt;br /&gt;
Peut être, dans les semaines à venir y aura-t-il d'autres mode (courbes de Beziers, polygone...) avec toutes les difficultés évoquées précédemment (GUI, modification de l'algorithme)&lt;br /&gt;
* Ellipse est le mode par défaut&lt;br /&gt;
* Rectangle peut également servir à travailler en mode pleine image (Full image)&lt;br /&gt;
&lt;br /&gt;
====Spot méthode====&lt;br /&gt;
Par défaut en mode &amp;quot;normal spot&amp;quot;.&lt;br /&gt;
Chaque RT-spot peut contenir tout ou partie des outils disponibles.&lt;br /&gt;
L'action est récursive&lt;br /&gt;
&lt;br /&gt;
En mode &amp;quot;excluding spot&amp;quot;&lt;br /&gt;
Chaque Rt-spot  peut contenir tout ou partie des outils disponibles.&lt;br /&gt;
Excluding réinitialise les données d'origine.&lt;br /&gt;
Excluding va par exemple permettre de supprimer des actions trop invasives ou de créer un mode inverse&lt;br /&gt;
&lt;br /&gt;
En mode &amp;quot;full image&amp;quot;, l'image entière est utilisée, par défaut seul le deltaE (position et taille du centre du Rt-spot) a une incidence. vous pouvez jouer sur les limites (situées au delà de l'image) et sur les transition pour ajouter des effets possibles (gradients, etc.)&lt;br /&gt;
&lt;br /&gt;
====Taille du Spot - Spot size====&lt;br /&gt;
La taille par défaut doit convenir dans une majorité de cas.&lt;br /&gt;
De petites valeurs, permettent de ne traiter par exemple que les feuilles d'un arbre (bien sûr en association avec Scope deltaE)&lt;br /&gt;
Des valeurs plus importantes vont permettre de gommer les petits écarts dans le calcul des références (hue, chroma, luma). Ceci peut être utile pour traiter la peau.&lt;br /&gt;
&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
* Transition value : permet de choisir l'incidence du réglage de tous les RT-spot. Géographiquement selon le réglage de Transition &amp;quot;X&amp;quot;, en-dessous de cette valeur 100% des réglages sont appliqués, au dessus il y a décroissance progressive (sauf si vous choisissez 100%)&lt;br /&gt;
** de très faibles valeurs permettent par exemple la réduction des défauts&lt;br /&gt;
&lt;br /&gt;
* Transition decay : traduit la vitesse d'affaiblissement au del de &amp;quot;X%&amp;quot; ci-dessus. Avec 1 la décroissance est linéaire,...avec 25 une loi exponentielle réduit considérablement l'incidence de l'action, la rendant quasiment nulle. Ceci permet de choisir des Rt-spot relativement importants pour traiter certaines actions (défauts,...) sans incidences (ou presque au delà de %)&lt;br /&gt;
&lt;br /&gt;
* Transition differentiation XY:  permet de différentier l'action selon l'abscisse ou l'ordonnée créant de fait une variation du gradient&lt;br /&gt;
&lt;br /&gt;
* Feather gradient : n'a aucune action si un des &amp;quot;Graduated filter&amp;quot; utilisable dans de nombreux outils n'est pas activé. Agit en pourcentage de la taille de diagonal du Rt-spot, lorsque un ou plusieurs des &amp;quot;Graduated filter&amp;quot; (luminance, chrominance, hue, local contrast) est utilisé.&lt;br /&gt;
&lt;br /&gt;
====Détection de forme====&lt;br /&gt;
*  DeltaE -scope threshold: permet d'adapter les réglages par défaut du deltaE au type d'image. Si l'image est avec un fort gamut (fleurs, couleurs artificielles,...) il peut être nécessaire d'accroître les valeurs.&lt;br /&gt;
&lt;br /&gt;
* DeltaE decay : accroît (ou réduit) l'efficacité du deltaE, de fortes valeurs vont rendre la sélection plus pertinente pour les images à fort gamut. L'intensité de l'action est ajustée en fonction du deltaE et de DeltaE decay - 1 linéaire - jusque 10 à très forte décroissance (puissance 10), en dessous de 1 il y a réduction..(par défaut 2). &lt;br /&gt;
&lt;br /&gt;
* ab-L balance (deltaE) : équilibre l'action de deltaE par rapport aux lois habituelles, plus axées vers  la luminance, ou vers la couleur.&lt;br /&gt;
&lt;br /&gt;
* C-H balance deltaE :   équilibre l'action de deltaE par rapport aux lois habituelles, plus axées vers le teinte, ou vers la chromaticité.&lt;br /&gt;
&lt;br /&gt;
* deltaE preview color - intensity et bouton associé &amp;quot;Peview DeltaE&amp;quot;: le slider permet de choisir la couleur visible &amp;quot;bleue&amp;quot; ou &amp;quot;verte&amp;quot; ainsi que son intensité. Le choix &amp;quot;vert&amp;quot; permet aussi de visualiser en couleur dans &amp;quot;mask and modifications&amp;quot;  - show modifications with or whithout mask. Presser le bouton donne un aperçu de ce qui est concerné par le deltaE (sans tenir compte pleinement ni des modifications, ni des transitions), mais cette possibilité est limitée à un outil actif (alternative : Mask and modifications : Preview deltaE)&lt;br /&gt;
&lt;br /&gt;
====Evite les dérives de couleur - Avoid Color shift====&lt;br /&gt;
Tente de remettre les couleurs dans le gamut du working profile, une correction Munsell est ensuite appliquée. Je recommande dans une majorité de cas, de cocher &amp;quot;avoid color shift&amp;quot;, associé à &amp;quot;Munsell correction only&amp;quot;. Ce choix permet une neutralité de L*a*b* en termes de teinte (hue), lorsqu'on change la saturation, et évite le contrôle de gamut qui peut amener des artefact dans les images surexposées.&lt;br /&gt;
&lt;br /&gt;
====Tous les changements forcés en noir et blanc====&lt;br /&gt;
Lorsque l'utilisateur a utilisé en amont de &amp;quot;Local adjustments&amp;quot; un module noir et blanc ou une simulation de films noir et blanc, cette case à cocher permet d'éviter l’apparition de couleurs dues aux réglages de &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Références récursives ====&lt;br /&gt;
Force l'algorithme à recalculer les références après chaque outil.&lt;br /&gt;
&lt;br /&gt;
====Forme Méthode====&lt;br /&gt;
Vous pouvez choisir plusieurs mode (désactivé par défaut):&lt;br /&gt;
* Indépendant (souris) - réglage par défaut&lt;br /&gt;
* Symétrique (souris)&lt;br /&gt;
* Indépendant (souris  + curseurs)&lt;br /&gt;
* Symétrique (souris + curseurs)&lt;br /&gt;
&lt;br /&gt;
====Wavelet Edge performance====&lt;br /&gt;
Une image qui a été décomposée en ses composantes par la méthode de Daubechies peut avoir jusqu'à 10 échelles de coefficients allant de D2 (qui correspond à la décomposition de Haar) à D20. Dans RawTherapee les coefficients ''D2 (faible), D4 (standard), D6 (standard plus), D10 (moyen)'' et ''D14 (élevé)'' sont utilisés. Plus il y a de coefficients, plus l'ondelette distinguera de détails, mais avec une légère augmentation du temps de traitement (souvent négligeable).&lt;br /&gt;
&lt;br /&gt;
Bien qu'il n'y ait pas de relation directe entre la qualité résultante et le nombre de coefficients (selon l'image d'origine), choisir le bon nombre de coefficients permettra d'affiner la qualité des niveaux inférieurs, ou celle de l'image résiduelle :&lt;br /&gt;
* dans certains cas, les meilleurs résultats pour la détection des contours sont obtenus avec D2&lt;br /&gt;
* dans les autres cas avec D6 ou D14&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Masque et Fusion====&lt;br /&gt;
Uniquement utilisé par les masques (lorsqu'ils sont activés : courbes LCH, etc.)&lt;br /&gt;
* case à cocher DeltaE image mask : Pour tous les masques :&lt;br /&gt;
** prend en compte le deltaE de l'image, pour éviter de modifier la zone de sélection lorsque les outils de masque suivants sont utilisés: Gamma, Pente, Chroma, Courbe de contraste, Contraste local (par niveau d'ondelette), Masque de flou et Masque de structure (si activé).&lt;br /&gt;
** désactivé lorsque le mode Inverse est utilisé.&lt;br /&gt;
* Scope (deltaE image mask) : permet de prendre en compte le deltaE pour l’élaboration des masques - ce réglage est sans action sur les différents &amp;quot;Scope&amp;quot; présent dans chaque outils - il permet une meilleure sélection du masque - suppose que un des outils masque est activé (chroma mask, contrast cuve mask, gamma mask, slope mask....)&lt;br /&gt;
* Denoise chroma mask : permet le contrôle du bruit chromatique du masque. utile pour un meilleur contrôle du bruit de chrominance et éviter les artefacts, notamment lorsque on utilise la courbe LC(h)&lt;br /&gt;
* Background color/luma mask : ajuste le niveau de gris ou de couleur de l'arrière plan des masques (Show mask and modifications).&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire - Soft process (Soft radius)===&lt;br /&gt;
Certains algorithmes peuvent être agressifs et sont dotés de cette fonction (sauf en mode Basic):&lt;br /&gt;
* Color &amp;amp; light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Level&lt;br /&gt;
&lt;br /&gt;
L'utilisation de &amp;quot;GuideFilter&amp;quot; sur la variation de luminance entre l'image originale et l'image modifiée, va permettre d'adoucir le résultat.&lt;br /&gt;
&lt;br /&gt;
Nota : &amp;quot;Shadows/Highlight &amp;amp; Tone Equalizer&amp;quot; possède par conception cet algorithme.&lt;br /&gt;
&lt;br /&gt;
Actuellement seule la luminance est traitée... rien ne s'oppose à traiter la dimension &amp;quot;couleur&amp;quot; soit sous la forme de &amp;quot;Chroma&amp;quot; (C*) soit sous la forme des 2 composantes a* et b*&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire : Graduated Filter - GF===&lt;br /&gt;
&lt;br /&gt;
En m'inspirant du &amp;quot;Graduated Filter&amp;quot; (gradient de luminance) présent dans le menu principal, j'ai élaboré 2 autres gradients:&lt;br /&gt;
* chrominance : il  est ainsi possible de faire varier la chrominance et réaliser des dégradés de chroma (ciel, portrait)&lt;br /&gt;
* hue :  il est possible de faire varier la teinte et réaliser des dégradés de teinte (paysages, réglages fins, effets spéciaux..)&lt;br /&gt;
Exemple d'utilisation d'un Graduated Filter avec Luminance Chrominance et Teinte  : [[Local Lab controls/fr#Réaliser un &amp;quot;Graduated Filter&amp;quot; Luminance - Chrominance et Teinte (filtre dégradé) | Exemple dans Premiers pas d'un Graduated Filter avec Luminance Chrominance et Teinte]]&lt;br /&gt;
&lt;br /&gt;
Les modules suivants sont dotés d'un module &amp;quot;Graduated Filter&amp;quot;&lt;br /&gt;
* Color &amp;amp; Light : luminance, chrominance, hue (teinte).&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure : luminance&lt;br /&gt;
* Shadows/Highlight &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, teinte&lt;br /&gt;
* Local contrast &amp;amp; Wavelet: uniquement Wavelet local contrast (au sens Wavelet)&lt;br /&gt;
&lt;br /&gt;
Le réglage de &amp;quot;feather&amp;quot; - répartition sur le RT-Spot du gradient - se trouve dans Settings&lt;br /&gt;
&lt;br /&gt;
Il n'y a pas &amp;quot;d'aide&amp;quot; avec la souris pour accompagner la rotation du gradient, c'est un curseur (-180 +180) qui permet cette fonctionnalité.&lt;br /&gt;
&lt;br /&gt;
Bien sûr les fonctions de &amp;quot;transition&amp;quot; et de &amp;quot;scope&amp;quot; sont conservées.&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire : fusion d'images===&lt;br /&gt;
Exemple d'utilisation de fusion d'images (Color &amp;amp; Light) :[[Local Lab controls/fr#Fusion d'images - modes de fusion (merge file)| Exemple dans Premiers pas de fusion d'images]]&lt;br /&gt;
&lt;br /&gt;
Dans &amp;quot;Color &amp;amp; light&amp;quot; vous pouvez choisir dans : &amp;quot;Merge image and Mask&amp;quot;, 5 possibilités:&lt;br /&gt;
* &amp;quot;None&amp;quot; : Rawtherapee utilise toutes ses fonctions habituelles y compris les masques&lt;br /&gt;
* &amp;quot;Original image&amp;quot; : permet la fusion de l'image courante avec l'originale sans aucune modification&lt;br /&gt;
* &amp;quot;Previous Spot&amp;quot; : permet la fusion de l'image courante avec l'image du spot précédent&lt;br /&gt;
* &amp;quot;Background&amp;quot; : permet de choisir un fond avec choix de couleur (hue, chroma) et luminance.&lt;br /&gt;
&lt;br /&gt;
====Background permet de simuler une brosse (brush)====&lt;br /&gt;
 En association avec: &lt;br /&gt;
* une faible taille du Rt-spot, &lt;br /&gt;
* une valeur très faible de transition, &lt;br /&gt;
* une valeur élevée de transition decay&lt;br /&gt;
* dupliquer le spot&lt;br /&gt;
&lt;br /&gt;
====Plusieurs types de fusion sont possibles avec ou sans utilisation du mask ====&lt;br /&gt;
&lt;br /&gt;
Bien sûr les fonctions de Scope et Transition sont conservées. &lt;br /&gt;
&lt;br /&gt;
Modes de fusion - similaires à ceux de Photoshop (c):&lt;br /&gt;
* normal, substract, difference, multiply, addition, divide, soft Light (legacy), SoftLight Illusion, Soft Light W3C,  hard light, overlay, screen, darken only, lighten only, exclusion, Hue, stauration, Color, Luminosity&lt;br /&gt;
* vous pouvez régler le &amp;quot;mélange&amp;quot; à l'aide du curseur &amp;quot;Opacity&amp;quot;&lt;br /&gt;
* Merge background (deltaE): prend en compte le deltaE lors de la fusion (un peu comme un équivalent de &amp;quot;Scope&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
====Exemple d'effet spécial obtenu avec &amp;quot;merge file&amp;quot;====&lt;br /&gt;
Bien sûr cet exemple n'est pas exhaustif, mais uniquement démonstratif.&lt;br /&gt;
L'exemple va permettre de créer un double dégradé sur fond flou.&lt;br /&gt;
&lt;br /&gt;
* créer un premier RT-spot, &amp;quot;Normal spot&amp;quot;, &amp;quot;Elipse&amp;quot;&lt;br /&gt;
** Inverse&lt;br /&gt;
** sélectionner avec les 4 délimiteurs, la zone à conserver exempte de flou gaussien&lt;br /&gt;
** Blur/grain &amp;amp; Denoise&amp;quot; / &amp;quot;Blur &amp;amp; Noise&amp;quot; / &amp;quot;Gaussian Blur - Noise Grain&amp;quot; : &lt;br /&gt;
** &amp;quot;Radius&amp;quot; 1000 à 10000 (utilise une transformé de Fourier FFTW) &lt;br /&gt;
** &amp;quot;Noise&amp;quot; : éventuellement si vous souhaitez ajouter du bruit de luminance&lt;br /&gt;
&lt;br /&gt;
* créer un deuxième RT-spot, &amp;quot;Normal spot&amp;quot;, &amp;quot;Elipse&amp;quot;, &amp;quot;Transition&amp;quot; 60, mais vous pourrez changer ensuite selon souhaits:&lt;br /&gt;
** mettre le centre de ce RT-spot à l'intérieur de l'aire du premier (zone exempte de flou)&lt;br /&gt;
** sélectionner avec les 4 délimiteurs, la zone qui sera avec un flou variable, évidemment au delà de la première. Si vous sélectionnez au delà de l'image, il n'y aura qu'une simple dégradé de flou. &lt;br /&gt;
** activer &amp;quot;Color &amp;amp; Light&amp;quot;&lt;br /&gt;
** &amp;quot;Scope&amp;quot; élévé proche de 100 ou 100&lt;br /&gt;
** &amp;quot;Merge File&amp;quot; : &amp;quot;Original Image&amp;quot;&lt;br /&gt;
** &amp;quot;Merge with Original or Previous or Background&amp;quot; : &amp;quot;Normal&amp;quot; ou autre par exemple &amp;quot;Soft Light Photoshop&amp;quot; - selon souhaits &lt;br /&gt;
*** Merge Background (deltaE) : 50 plus ou moins selon souhaits&lt;br /&gt;
*** Opacity : 50 plus ou moins selon souhaits&lt;br /&gt;
*** Contrast Threshold : selon souhaits&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===RT-spot et calques===&lt;br /&gt;
Lorsque vous créez un nouveau Spot, un &amp;quot;calque&amp;quot; est créé, c'est en réalité une copie de l'image précédente entière, même si le Spot est petit.&lt;br /&gt;
&lt;br /&gt;
Imaginons que l'utilisateur à créé 2 spots, on aboutit à :&lt;br /&gt;
* calque N°1 : image originale non modifiée (celle qui est en &amp;quot;réserve&amp;quot;) et qui peut servir pour &amp;quot;excluding spot&amp;quot;&lt;br /&gt;
* calque N°2 : image copie de N°1 avec le Spot créé, par exemple la retouche d'une fleur à gauche de l'image&lt;br /&gt;
* calque N°3 : image copie de n°2 avec un deuxième Spot créé, par exemple un portrait à droite de l'image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Lorsqu'on fusionne N°2 et N°1 (Fusion du premier Spot avec &amp;quot;Original&amp;quot;), les modes de fusion répondent comme on s'y attend, par exemple si on active &amp;quot;mode difference&amp;quot;, l'image dans la zone concernée de la fleur sera noire (si Scope est à 100)&lt;br /&gt;
#Si on fusionne N°3 et N°1 (Fusion du 2ème Spot avec &amp;quot;Original&amp;quot;), les modes de fusion laisseront apparaître l'image entière créée à l'occasion de la création du Spot N°1, donc le mode de fusion &amp;quot;difference&amp;quot; ne fera pas apparaître une image noire.&lt;br /&gt;
#Si on fusionne N°3 et N°2 (Fusion du 2ème Spot avec &amp;quot;Previous&amp;quot;),les modes de fusion laisseront apparaître l'image entière &amp;quot;originale&amp;quot;, donc le mode de fusion &amp;quot;difference&amp;quot; ne fera pas apparaître une image noire.&lt;br /&gt;
&lt;br /&gt;
Les mode de fusion sont sensibles aux paramètres de chaque RT-Spot, par exemple dans le cas de l'exemple N°1 ci-dessus, l'image noire ne sera possible que si Scope = 100&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire - Recovery based on luminance mask===&lt;br /&gt;
Est utile pour moduler les effets d'un outil (lorsque il est doté de cette fonction). Le système est fondé sur les informations de luminance, lorsqu'on utilise les courbes L(L) ou LC(H) dans &amp;quot;Mask and modifications&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Il est évident que le masque doit être activé, ainsi que au moins une des courbes ci-dessus.&lt;br /&gt;
&lt;br /&gt;
Les zones &amp;quot;Dark&amp;quot; et &amp;quot;Light&amp;quot; situées en dessous du seuil &amp;quot;dark&amp;quot; et au-dessus du seuil &amp;quot;Light&amp;quot; seront progressivement restaurées à leurs valeurs d'origine avant d'être modifiées par les paramètres de l'outil en cours (Color &amp;amp; Light, Shadows/Highlight &amp;amp; Tone Equalizer, etc.)&lt;br /&gt;
&lt;br /&gt;
Entre ces deux zones, la valeur des paramètres de l'outil en cours sera appliquée.&lt;br /&gt;
&lt;br /&gt;
===Algorithme complémentaire - Mask and Modifications=== &lt;br /&gt;
Exemple d'utilisation d'un masque: [[Local Lab controls/fr#Utilisation d'un masque simple pour accroître la sélection de couleur| Exemple dans Premiers pas pour accroître la sélection de couleurs]] &lt;br /&gt;
&lt;br /&gt;
====Préambule====&lt;br /&gt;
Les masques dans &amp;quot;Local adjustments&amp;quot; sont d'une conception personnelle.&lt;br /&gt;
Le point de départ qui m'a inspiré est situé dans &amp;quot;Color Toning&amp;quot;, &amp;quot;Mask&amp;quot;, est l'utilisation de 3 courbes H, C, L.&lt;br /&gt;
Le reste a des particularités spécifiques:&lt;br /&gt;
* qui peuvent surprendre l'utilisateur habitués aux masques des autres logiciels en service;&lt;br /&gt;
* possède des limitations, souvent les mêmes que celles liées de manière générale dans &amp;quot;Local adjustments&amp;quot;, pas de possibilités de basculer le masque, ni de faire des courbes de Bezier ou des polygones;&lt;br /&gt;
* par contre il est doté de possibilités que je pense rares comme par exemple (en mode avancé) et pour certains outils: &lt;br /&gt;
** &amp;quot;Structure mask&amp;quot;, la structure de l'image sera utilisée seule, ou en combinaison avec les autres outils du masque, pour renforcer la différentiation des zones claires et sombres.&lt;br /&gt;
** &amp;quot;Blur Mask&amp;quot; qui va faire varier le contraste du masque, là encore pour renforcer la différentiation des zones claires et sombres.&lt;br /&gt;
** &amp;quot;Wavelet selection&amp;quot; qui selon les niveaux minima et maxima de décomposition en ondelettes va modifier le masque.&lt;br /&gt;
&lt;br /&gt;
Certains diront, il manque ceci, il manque cela,.. c'est sûr. Tout développeur qui souhaite modifier le code pour atteindre d'autres objectifs est libre de le faire.&lt;br /&gt;
&lt;br /&gt;
Les masques ne sont accessible que si le sélecteur de complexité est sur &amp;quot;Standard&amp;quot;, ou &amp;quot;Advanced&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Les 11 modules &amp;quot;Color &amp;amp; Light&amp;quot; , &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;, &amp;quot;Shadows/Highlight &amp;amp; Tone Equalizer&amp;quot;,&amp;quot;Vibrance &amp;amp; Warm/cool&amp;quot;, &amp;quot;Log encoding&amp;quot;, &amp;quot;Color appearance(Cam16 &amp;amp; JzCzHz)&amp;quot;, &amp;quot;Contrast by details levels&amp;quot;,&amp;quot;Local contrast &amp;amp; Wavelets&amp;quot;, &amp;quot;Tone mapping&amp;quot;, &amp;quot;Retinex&amp;quot; , &amp;quot;Blur/grain &amp;amp; Denoise&amp;quot; (ces 2 deux modules ont un masque commun) - ont la possibilité d'utiliser un masque:&lt;br /&gt;
*Pour 3 modules : &amp;quot;Color &amp;amp; light&amp;quot;, &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;, &amp;quot;Shadows/highlight &amp;amp; Tone Equalizer&amp;quot;, ces masques peuvent être utilisés en mode inverse (avec des limitations)&lt;br /&gt;
*Pour 2 modules : &amp;quot;Blur/Grain&amp;quot; et &amp;quot;Denoise&amp;quot;, le masque est commun&lt;br /&gt;
*Pour 2 modules : &amp;quot;Tone mapping&amp;quot; et &amp;quot;Retinex&amp;quot;, le masque peut être utilisé &amp;quot;avant&amp;quot; le traitement ou &amp;quot;après le traitement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Vous pouvez agir sur la luminance de l'arrière plan des masques (menu settings), par défaut il est réglé à 10. A zéro, le masque traduit les réelles modifications, mais on peut moins percevoir les détails de structure.&lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
Ce menu déroulant dispose de plusieurs choix, variables selon les outils&lt;br /&gt;
* Show modified image : montre les modifications de l'image en prenant en compte les effets de l'outil et du masque.&lt;br /&gt;
* Show modifed areas without mask : montre l'aperçu des modifications - prend en compte les transitions – avant toute action sur les masques&lt;br /&gt;
* Show modified areas with mask : montre l'aperçu des modifications si le masque est activé - prend en compte les transitions&lt;br /&gt;
* Show mask : permet de visualiser l'aspect du masque avec l'action sur les courbes, filtres divers - ne prend pas en compte les transition et le deltaE principal, prend en compte le &amp;quot;Mask deltaE image&amp;quot; (Scope Mask deltaE image)&lt;br /&gt;
* Show Spot structure (Advanced) : permet de visualiser l'effet sur la structure du curseur &amp;quot;Structure Spot&amp;quot; lorsqu'il est implanté&lt;br /&gt;
* Preview DeltaE : permet visualiser l'image avec le deltaE quelque soit l'outil&lt;br /&gt;
&lt;br /&gt;
====Ces masques visent 2 objectifs principaux:====&lt;br /&gt;
#augmenter la sensibilité de détection et donc permettre une meilleure sélection des objets (objectif principal), sans modifier l'image, lorsque l'algorithme deltaE n'est pas suffisamment pertinent (rare).&lt;br /&gt;
#aboutir à des effets spéciaux en combinant l'image du masque et celle originale.&lt;br /&gt;
&lt;br /&gt;
====Fonctionnalités====&lt;br /&gt;
=====Courbes LCH=====&lt;br /&gt;
L'image est modifiée avant le traitement (exception pour &amp;quot;Tone mapping&amp;quot; et &amp;quot;Retinex&amp;quot; où l'image servant au masque peut tenir compte du traitement) par les algorithmes de &amp;quot;Color &amp;amp; Light&amp;quot;, &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;, &amp;quot;Shadows Highlight &amp;amp; Tone Equalizer&amp;quot;, &amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot;, &amp;quot;Log Encoding&amp;quot;, &amp;quot;Color Appearance&amp;quot; &amp;quot;Contrast by details levels&amp;quot;, &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; mais ces modifications sont prises en compte par les algorithmes de &amp;quot;Local adjustments&amp;quot; que ce soit la détection de forme, les transitions, ...&lt;br /&gt;
L'utilisateur dispose de 3 courbes qui sont au démarrage toutes positionnées à 1 (maximum) :&lt;br /&gt;
* C=f(C) la chrominance varie en fonction de la chrominance, l'utilisateur peut ainsi diminuer la chroma pour améliorer la sélection. &lt;br /&gt;
* L=f(L) la luminance varie en fonction de la luminance, l'utilisateur peut ainsi diminuer la luminosité pour améliorer la sélection&lt;br /&gt;
* L et C = f(H) la luminance et la chrominance varient en fonction de la teinte, l'utilisateur peut ainsi diminuer la luminosité et la chroma pour améliorer la sélection.&lt;br /&gt;
&lt;br /&gt;
Si l'utilisateur positionne les courbes près de l'ordonnée zéro, l'effet des masques sera inversé.&lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
Un masque utilisant la structure de l'image (différenciation des zones sans contraste - ciels, aplats.. - et des zones avec contraste &amp;quot;habitations&amp;quot;, &amp;quot;reliefs&amp;quot;, ... -) peut être utilisé de 2 façons:&lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; (slider Threshold) avec la case à cocher &amp;quot;Structure mask as tool&amp;quot; non cochée : Dans ce cas, un masque faisant apparaître la structure sera généré même si aucune des 3 courbes n'est activée. Une action modérée sur le slider est recommandée !&lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; (slider Threshold) avec la case à cocher &amp;quot;Structure mask as tool&amp;quot; cochée : Dans ce cas, un masque faisant apparaître la structure sera généré après la mise en œuvre des courbes &amp;quot;Mask Curves : L(L) ou LC(H). Ici, &amp;quot;Structure mask&amp;quot; se comporte comme les autres outils : gamma, slope, etc. Il permet de différencier l'action sur le masque selon la structure de l'image. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; est disponible pour les masques &amp;quot;Blur/Grain &amp;amp; denoise&amp;quot; et &amp;quot;Color &amp;amp; Light&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
Un maque utilisant la création d'un flou à grand rayon (Mask Blur), permet de faire varier le contraste de l'image et/ou assombrir / éclaircir des parties d'images (Color &amp;amp; Light)&lt;br /&gt;
* Contrast threshold: permet de déterminer en fonction de la texture de l'image, les zones impactées ou non&lt;br /&gt;
* Radius: permet de faire varier le &amp;quot;rayon&amp;quot; du flou gaussien (0 à 500)&lt;br /&gt;
* case à cocher FFTW : utilise la transformée de Fourier pour une meilleure qualité (augmentation du temps de traitement et des besoins en mémoire)&lt;br /&gt;
&lt;br /&gt;
A noter que selon le &amp;quot;mode&amp;quot; (advanced, standard, basic), cette fonction est ou non présente. De plus en mode &amp;quot;absence de FFTW&amp;quot; le rayon limité à 100.&lt;br /&gt;
&lt;br /&gt;
=====Radius et Laplacian Theshold=====&lt;br /&gt;
L'utilisation simultanée des 2 filtres est peu conseillée (cas sans résolution de l'équation PDE)&lt;br /&gt;
======Radius======&lt;br /&gt;
Un curseur &amp;quot;radius&amp;quot; - utilisant &amp;quot;GuideFilter&amp;quot; permet de diminuer les artefacts et adoucir les transitions.&lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Permet une modification de la luminance du masque en accroissant la luminance des zones claires.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
Vous pouvez modifier le masque - avec bien sûr l'incidence inverse sur l'image - à l'aide de 3 curseurs qui jouent:&lt;br /&gt;
* sur la chroma en adaptant sa force à la valeur réelle rencontrée qui dépend de plusieurs facteurs dont la grandeur de l'espace de travail (sRGB, Prophoto, ...). &lt;br /&gt;
* sur le gamma et la pente &amp;quot;Slope&amp;quot; (même principe par exemple que le gamma sRGB). La fonction agit sur le canal Luminance L*. Cette fonction, sans discontinuité, associe une partie linéaire pour les basses lumières et une courbe parabolique au delà.&lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend permet de mélanger en plus ou en moins le masque avec l'image en cours&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* tous les masques sont dotés de la fonction &amp;quot;contrast curve&amp;quot;&lt;br /&gt;
* 2 masques &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot; et &amp;quot;Color &amp;amp; Light&amp;quot; sont dotés d'un contraste local fondé sur les &amp;quot;wavelets&amp;quot; avec choix du niveau&lt;br /&gt;
* &amp;quot;Color and Light&amp;quot; est doté de la fonction H=f(H) qui permet des retouches fine de la teinte, par exemple pour la peau&lt;br /&gt;
=====Quel usage, quelle action, sur la luminance des masques et la couleur=====&lt;br /&gt;
* Gamma et Slope : permet une transformation douce et sans artefacts du masque avec une action sur &amp;quot;L&amp;quot; très progressive sans aucune discontinuité&lt;br /&gt;
* Contrast curve : peut être utilisée comme &amp;quot;Gamma et slope&amp;quot;, mais son usage est une action ciblée sur certaines parties (en général les plus claires du masque) en utilisant une courbe excluant les parties sombres&lt;br /&gt;
* Wavelet local contrast : permet de diminuer ou accroître l'action sur le niveau de détail souhaité du masque, en privilégiant l'action sur certaines zones de luminance (en général les plus claires)&lt;br /&gt;
* Hue curve : permet la retouche fine de la couleur du masque, évidemment les seules couleurs qui peuvent être impactées sont celles qui apparaissent dans le masque&lt;br /&gt;
&lt;br /&gt;
=====Case à cocher &amp;quot;Mask deltaE Image&amp;quot; et curseur &amp;quot;Scope Mask DeltaE image (menu Settings)=====&lt;br /&gt;
Ces 2 fonctionnalités permettent&lt;br /&gt;
* pour chaque masque.&lt;br /&gt;
* pour les curseurs et courbes qui modifient l'action sur les masques après leur élaboration : &lt;br /&gt;
** curseurs :&amp;quot;gamma&amp;quot; &amp;quot;Chroma&amp;quot; &amp;quot;slope&amp;quot;&lt;br /&gt;
** courbes : &amp;quot;contrast curve&amp;quot; , &amp;quot;Levels contrast&amp;quot; (lorsque cette courbe est présente), &amp;quot;Hue curve&amp;quot; (lorsqu'elle est présente)&lt;br /&gt;
* d'éviter une action sur la zone de sélection - celle où est présente le RT- spot&lt;br /&gt;
* le plus &amp;quot;Scope&amp;quot; sera faible, plus l'action sera différenciée&lt;br /&gt;
* cette fonctionnalité est désactivée en mode &amp;quot;Inverse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Utilisation====&lt;br /&gt;
Comment procéder, pour l'essentiel pour l'objectif n°1 ?&lt;br /&gt;
* pour satisfaire l'objectif n°1 il est impératif de ne pas (ou peu) modifier la zone où se trouve le &amp;quot;spot&amp;quot;. Le GUI permet de visualiser sur la courbe elle même la valeur de L, C ou H à éviter de modifier, c'est à l'utilisateur de positionner correctement le point des courbes qui ne sera pas modifié. Il suffit de positionner le sommet de la courbe à chacun de ces points (limite de la transition gris foncé, gris clair) selon le cas.&lt;br /&gt;
* attention, la case à cocher &amp;quot;Recursive reference&amp;quot; peut interagir sur cette limite (gris foncé, gris clair) : si le masque concerne le module sur lequel on souhaite agir (par exemple &amp;quot;Exposure compensation&amp;quot; pour le module &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;),il est souhaitable, pour trouver la bonne valeur pour le masque de désactiver l'expander. &lt;br /&gt;
&lt;br /&gt;
* ensuite en examinant le masque, vous pouvez réduire très raisonnablement les valeurs de chroma, ou luma, selon le cas. Des réductions de 10 à 20% sur l'échelle des ordonnées doivent être suffisante dans la majorité des cas, comme dans l'exemple ci-dessous.&lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Accroître la sensibilité de la sélection]]&lt;br /&gt;
&lt;br /&gt;
* pour satisfaire l'objectif n°1, il est souhaitable que le curseur &amp;quot;blend&amp;quot; soit à zéro.&lt;br /&gt;
&lt;br /&gt;
Pour l'objectif n°2, tout est fonction de ce que l'on veut faire, mais je recommande quand même d'appliquer le même processus que ci-dessus, sinon que les valeurs d'affaiblissement peuvent être plus importantes que 10 à 20% et atteindre si nécessaire 100%. A noter que le masque utilisé dans le cas de l'objectif n°2, sera aussi utilisé pour accroître la sélection comme dans l'objectif n°1, mais les effets seront augmentés.&lt;br /&gt;
* pour satisfaire l'objectif n°2, il est souhaitable que les curseur &amp;quot;blend&amp;quot; ne soient pas à zéro: si vous réglez blend:&lt;br /&gt;
** avec des valeurs négatives, l'image complémentaire au masque sera soustraite de l'image originale, dans le cas d'un masque L, l'image résultante va s'assombrir, &lt;br /&gt;
** avec des valeurs positives et ajoutée l'image complémentaire au masque sera ajoutée à l'image originale, dans le cas d'un masque L, l'image résultante va s'éclaircir.&lt;br /&gt;
&lt;br /&gt;
Plusieurs assistances sont proposées pour aider aux processus :&lt;br /&gt;
* a) visualisation du masque dans tous les cas&lt;br /&gt;
* b) visualisation des modifications sans le masque (pas en inverse)&lt;br /&gt;
* c) visualisation des modifications avec le masque (pas en inverse)&lt;br /&gt;
et également pour l'action sur la structure, l’aperçu d'un masque de structure (pas en inverse).&lt;br /&gt;
Il n'est - ceci peut paraître évident - pas possible d'utiliser plusieurs masques en même temps...mais une fois généré ils peuvent être utilisés ensemble&lt;br /&gt;
&lt;br /&gt;
Vous pouvez changer l'aspect de la visualisation des modifications avec et sans le masque dans &amp;quot;Settings&amp;quot;&lt;br /&gt;
* &amp;quot;DeltaE preview clor - intensity&amp;quot;&lt;br /&gt;
** les valeurs positives du curseur ne modifient l’apparence des couleurs&lt;br /&gt;
** les valeurs négatives du curseur ajoutent la composante &amp;quot;b&amp;quot; (de L* a* b*) et ainsi permettent une meilleure visualisation des changements de luminance.&lt;br /&gt;
&lt;br /&gt;
A noter la consommation importante de mémoire liée à ces masques lors de la sélection de zones étendues.&lt;br /&gt;
A noter également le côté peu intuitif des masques, les actions sur les masques se traduiront par un effet inversé sur l'image.&lt;br /&gt;
&lt;br /&gt;
====Utilisation isolée des masques ====&lt;br /&gt;
Chaque module équipé de &amp;quot;mask&amp;quot; peut être utilisé sans activer les commandes internes à chaque module. Par exemple:&lt;br /&gt;
* &amp;quot;Log encoding&amp;quot; qui est le premier outil situé avant &amp;quot;Denoise&amp;quot; dans &amp;quot;Succession des outils dans le pipeline;&lt;br /&gt;
* tout module situé en amont du module courant (par exemple utiliser le masque de &amp;quot;Contrast by detail levels&amp;quot;, si le module courant est &amp;quot;Color &amp;amp; Light&amp;quot;) &lt;br /&gt;
* cette utilisation des masques, sans utiliser les sliders, courbes, des outils, va permettre de modifier l'image au début du process; par exemple modifier le gamma de l'image!&lt;br /&gt;
* &amp;quot;Color Appearance(Cam16 &amp;amp; JzCzHz)&amp;quot; est le dernier module dans &amp;quot;Succession des outils dans le pipeline&amp;quot;. Il peut être utilisé uniquement pour les masques, sans utiliser les sliders ou les courbes de l'outil. Ceci va permettre de modifier l'image à la fin du process.&lt;br /&gt;
&lt;br /&gt;
Bien sûr, autres modules avec &amp;quot;mask&amp;quot; peuvent aussi être utilisés seuls, à l'exception de Retinex.&lt;br /&gt;
&lt;br /&gt;
====Utilisation de plusieurs masques====&lt;br /&gt;
Pour chaque RT-spot et chaque outil (Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) vous ne pouvez utiliser qu'un seul masque associé à cet outil, mais il est très facile d'en utiliser plusieurs.&lt;br /&gt;
&lt;br /&gt;
Le masque suivant prendra en compte les résultats du précédent.&lt;br /&gt;
&lt;br /&gt;
=====Comment utiliser plusieurs masques pour un même outil ?=====&lt;br /&gt;
C'est très simple, il suffit d'activer (expander) un autre outil équipé d'un masque, et de mettre en œuvre le masque.&lt;br /&gt;
Vous n'êtes pas obligé de mettre en œuvre l'outil, par exemple vous pouvez vous servir du masque de Contrast by detail levels, sans aucune action Contrast by detail levels (tous les curseurs à 1)&lt;br /&gt;
Les masques agissent dans l'ordre de celui de la Succession des outils dans la pipeline.&lt;br /&gt;
&lt;br /&gt;
* Les masques suivants : Color &amp;amp; light, Blur/grain &amp;amp; Denoise, permettent l'utilisation d'un &amp;quot;contraste local&amp;quot; fondé sur le niveau de wavelet, ainsi qu'un ajustement  sur des ombres et des tons moyens  : curseur  Shadows (Color &amp;amp; Light, Blur/gain &amp;amp; Denoise) et les tons clairs curseur Highlights (Blur/grain &amp;amp; Denoise).&lt;br /&gt;
* Le masque Color &amp;amp; Light permet l'utilisation d'une courbe hue = f(hue).&lt;br /&gt;
* le masque Vibrance &amp;amp; Warm/Cool est un peu particulier, car il n'y a pas d'action sur la luminance dans Vibrance (sinon pour le contrôle du gamut), les réponses en luminance seront donc très faibles. &lt;br /&gt;
&lt;br /&gt;
Bien sûr on peut combiner cela avec les actions Merge file et DeltaE Image mask (Settings).&lt;br /&gt;
&lt;br /&gt;
=====Comment utiliser plusieurs masques pour un même outil en dupliquant le RT-spot ?=====&lt;br /&gt;
Il suffit de dupliquer le RT-spot et d'ajuster sa position et ses dimensions.&lt;br /&gt;
Cette action permet:&lt;br /&gt;
* de prendre en compte les nouvelles valeurs des valeurs de référence (hue, chroma, luminance)&lt;br /&gt;
* de changer la zone d'action&lt;br /&gt;
* de changer l'ordre des masques.&lt;br /&gt;
&lt;br /&gt;
====Cas spécifique de Retinex====&lt;br /&gt;
Le module masque de Retinex ressemble aux autres mais:&lt;br /&gt;
* il ne permet l'accès à l'objectif 1) &amp;quot;accroître les capacités de sélection&amp;quot; que en mode &amp;quot;normal&amp;quot; (pas d'utilisation de transmission map)&lt;br /&gt;
* lorsque l'option &amp;quot;Use transmission map&amp;quot; est choisie, le comportement n'est plus &amp;quot;traditionnel&amp;quot;: &lt;br /&gt;
** mais va permettre une exploitation de &amp;quot;Retinex&amp;quot; exploitant au maximum les effets de contraste local. A noter que le système se comporte de la même manière pour les valeurs positives ou négatives de &amp;quot;blend&amp;quot;&lt;br /&gt;
** avec &amp;quot;Use transmission map&amp;quot; la fonction d'aide indiquant graphiquement les valeurs &amp;quot;référence&amp;quot; 'hue&amp;quot;, &amp;quot;Luma&amp;quot;, &amp;quot;Chroma&amp;quot; sont totalement erronées...&lt;br /&gt;
&lt;br /&gt;
===Masque commun couleur===&lt;br /&gt;
Exemple d'utilisation d'un Masque commun couleur:[[Local Lab controls/fr#Comment se servir de Common Color Mask - puis Exemple de combinaison avec une fusion de 2 RT-Spot| Exemple dans Premiers pas Masque commun couleur]]&lt;br /&gt;
&lt;br /&gt;
Ce masque a, en termes d'outils, les mêmes spécifications que les autres masques cités plus haut.&lt;br /&gt;
Par contre son fonctionnement et son principe est différent:&lt;br /&gt;
* les masques précédents viennent en complément d'un outil, ils améliorent la sélection, ou changent l'image après modifications par un outil (Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.)&lt;br /&gt;
&lt;br /&gt;
Dans le cas présent, le masque se comporte comme un outil:&lt;br /&gt;
* ce sont soit les 3 courbes C(C), L(L), LC(H), soit en mode &amp;quot;advanced&amp;quot;, &amp;quot;Mask structure&amp;quot; ou &amp;quot;Mask blur&amp;quot; qui vont générer des différences de couleurs ou de structure de l'image par rapport à l'image originale&lt;br /&gt;
* cette &amp;quot;différence&amp;quot; est de même type que celle par exemple générée par &amp;quot;Lightness&amp;quot;, ou &amp;quot;chrominance&amp;quot; dans &amp;quot;Color &amp;amp; Light&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Pour utiliser cette particularité, &amp;quot;Masque commun&amp;quot; est doté de 3 curseurs supplémentaires:&lt;br /&gt;
* &amp;quot;scope&amp;quot; : permet de gérer en fonction de la position du RT-spot et des réglages de &amp;quot;Settings&amp;quot;, le deltaE (les autres curseurs Scope sont totalement inactifs)&lt;br /&gt;
* Add / substract mask luminance : permet d'ajouter ou retrancher le masque &amp;quot;Luminance&amp;quot; de l'image originale &lt;br /&gt;
* Add / substract mask Chrominance : permet d'ajouter ou retrancher le masque &amp;quot;Chrominance&amp;quot; de l'image originale &lt;br /&gt;
* ces 2 curseurs réglés à zéro, amènent aucune action&lt;br /&gt;
* &amp;quot;Scope&amp;quot; agit sur l'écart généré par les 2 curseurs &amp;quot;add / substract&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Le fonctionnement en mode inverse===&lt;br /&gt;
Lorsqu'il est proposé, le fonctionnement en mode inverse est simplifié, certaines fonctions ne sont pas implémentées (mask partiel, certaines courbes,...).&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Situé dans &amp;quot;Settings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Deux objectifs sont visés:&lt;br /&gt;
* mettre les couleurs dans le gamut de l'espace de travail courant (working profile) en utilisant une colorimétrie relative ;&lt;br /&gt;
* ajuster les couleurs à l'aide d'une correction &amp;quot;Munsell&amp;quot; - notamment les rouges-orangés et les bleus-pourpres, lorsque la saturation dans le domaine L*a*b* a évolué notablement.&lt;br /&gt;
&lt;br /&gt;
Difficultés : &lt;br /&gt;
* le mode L*a*b* a certes des avantages, mais il n'a pas de limites. C'est à dire que si une couleur est presque hors gamut en RGB, une fois convertie en L*a*b* rien ne s'oppose si l'utilisateur change la saturation d'aller vers des  couleurs imaginaires (il faut y vraiment changer considérablement les valeurs L* ou a* ou b*). Ce pourquoi, il est (parfois) bon, de contrôler le gamut;&lt;br /&gt;
* mais, l'algorithme utilisé sait très mal gérer les hautes lumières brulées. Par exemple là où un traitement a été fait avec &amp;quot;highlight reconstruction&amp;quot;, il va détruire ce travail.&lt;br /&gt;
&lt;br /&gt;
En conséquence, pour des images où on est proche du gamut (fleurs, couleurs artificielles,..), et qu'un traitement accroît la saturation,  et lorsqu'il y a une zone avec des très hautes lumières brulées&lt;br /&gt;
* soit on n'applique pas &amp;quot;avoid color shift&amp;quot;, mais les couleurs L*a*b* dans les bleus-pourpres ou les rouges-orangés vont dériver.&lt;br /&gt;
* soit on applique &amp;quot;avoid color shift&amp;quot;, mais en cochant la case &amp;quot;Munsell corrrection only&amp;quot;. On risque d'avoir des couleurs imaginaires..c'est à dire hors du champ visuel humain (est-ce grave ?)&lt;br /&gt;
* soit on applique &amp;quot;avoid color shift&amp;quot;, qui par défaut contrôle le gamut, et applique la correction Munsell. Et on utilise un &amp;quot;excluding spot&amp;quot; pour les zones des hautes lumières à préserver.&lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
La transformé de Fourier - Fast Fourier Transform - sous sa forme &amp;quot;FFTW real DCT&amp;quot; est utilisée dans Rawtherapee et notamment dans &amp;quot;Local adjustements&amp;quot; sous 3 formes:&lt;br /&gt;
* Créer un flou Gaussien &amp;quot;Blur&amp;quot; &lt;br /&gt;
* Résoudre l'équation de Poisson PDE - suite à un Laplacien&lt;br /&gt;
* Réduire le bruit&lt;br /&gt;
Elle peut se traduire (images de taille importante - Full image) par des temps de traitement plus importants.&lt;br /&gt;
&lt;br /&gt;
====Flou Gaussien====  &lt;br /&gt;
Dans 2 modules de &amp;quot;Local Adjustements&amp;quot;, une case à cocher &amp;quot;Use Fast Fourier&amp;quot; (FFT) a été ajoutée, elle permet d'utiliser la transformée rapide de Fourier, pour générer le flou (blur) nécessaire à Multi Scale Retinex (pas installé dans Retinex &amp;quot;pleine image&amp;quot;) ou &amp;quot;Local contrast unsharp&amp;quot;, &lt;br /&gt;
*La formule utilisée pour le flou est la formule de Gauss qui s'applique après la transformée et avant la transformée inverse. &lt;br /&gt;
*formule de Gauss G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*celle appliquée est sa version &amp;quot;Fourier&amp;quot;  G(x,y) =  exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
Cette formule par définition est exacte quelque soit le rayon sigma.&lt;br /&gt;
&lt;br /&gt;
A noter pour le flou, la différence de rendu avec la fonction utilisée dans Rawtherapee qui utilise une série de formules approximatives, FFT est quasiment exacte, donc de meilleure qualité.&lt;br /&gt;
Pour Retinex MultiScale il est possible (pas recommandé) d'utiliser la variable Fftwsigma=true dans &amp;quot;options&amp;quot;. Si vous basculez sur &amp;quot;false&amp;quot;, l'algorithme FFT sera modifié pour essayer de s'approcher de la formule &amp;quot;ancienne&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Résoudre l'équation de Poisson PDE====&lt;br /&gt;
Sont concernés par cette utilisation :&lt;br /&gt;
* Original Retinex pour atténuer les différences de luminance notamment sur les portraits&lt;br /&gt;
* Exposure avec 2 modules : a) PDE Ipol Contrast atenuator; b) PDE Fatal - Dynamic Range Compression (similaire à Dynamic Range Compression &amp;quot;pleine Image&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
====Réduire le bruit====&lt;br /&gt;
Dans &amp;quot;Local Adjustements&amp;quot; la FFT vient en complément des ondelettes pour réduire le bruit de Luminance et de chrominance. (non installé pour Chrominance dans Denoise &amp;quot;main&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
====Optimisation FFT====&lt;br /&gt;
La FFT (Fast Fourier Transform) a un temps de traitement qui ne dépend que la surface a traiter et bien sûr du nombre d'appels (exemple scale Retinex), l'application de la fonction de Gauss, est quasi instantanée et indépendante du rayon.&lt;br /&gt;
A noter l'optimisation de la FFT lorsque les dimensions (H, W) de la zone correspondent à la décomposition en facteurs premiers et uniquement ceux-ci. 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (avec a + b = 0 ou 1)&lt;br /&gt;
* une table utilisée par le code permet de sélectionner les dimensions appropriées : elle est actuellement utilisable jusqu'à une dimension (L ou H) de 18144 pixels&lt;br /&gt;
* Cette optimisation n'est pas effective dans le Preview. &lt;br /&gt;
* Le gain de temps peut varier d'un facteur 2 à 10: 10 si les dimensions du RT-spot sont de type 2^n, 2 si on a la combinaison maximale des facteurs premiers. De ce fait FFTW peut passer plus de temps pour un &amp;quot;petit&amp;quot; spot que pour un &amp;quot;grand&amp;quot;&lt;br /&gt;
* A noter que si vous souhaitez sélectionner toute l'image (full image), la dimension de la zone traitée avec FFTW sera un peu plus grande que la taille de l'image (quelques pixels) afin de permettre que toute l'image soit traitée.&lt;br /&gt;
&lt;br /&gt;
====Précision des calculs====&lt;br /&gt;
La version FFTW est &amp;quot;float&amp;quot;, après plusieurs essais cette précision semble suffisante, les erreurs après une transformée suivie d'une transformée inverse, concernent sur une image entière quelques pixels isolés avec des différences inférieures à 1/1000ème, sur la globalité de l'image pas de différences mesurables.&lt;br /&gt;
&lt;br /&gt;
Il doit être possible  - si la nécessité s'impose - d'installer dans GitHub - la version &amp;quot;double&amp;quot; de FFTW&lt;br /&gt;
&lt;br /&gt;
==Quelques particularités du mode local (par rapport à Lab adjustements)==&lt;br /&gt;
&lt;br /&gt;
Voici quelques informations qui peuvent intéresser l'utilisateur. Ces informations sont souvent des particularités du mode local&lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*Les algorithmes utilisés pour la luminance et le contraste sont différents de ceux utilisés par Lab adjustements (main), ce qui peut amener quelques différences de rendu.&lt;br /&gt;
&lt;br /&gt;
Un exemple avec Color &amp;amp; light:[[Local Lab controls/fr#Ajouter l'outil Color &amp;amp; Light | Exemple dans Premiers pas avec Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|Avec Color correction grid]] &lt;br /&gt;
* Vous disposez d'une fonction &amp;quot;Color correction grid&amp;quot; qui peut être selon le cas :&lt;br /&gt;
Deux méthodes sont possibles: Color Toning et Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
# Dans ce cas, la luminance est prise en compte dans la variation de la chroma&lt;br /&gt;
# l'équivalent d'une fonction H=f(H) si le &amp;quot;point blanc&amp;quot; de grid reste à zéro et si vous ne faites varier que le point noir.&lt;br /&gt;
# l’équivalent d'un Color toning si vous faites varier les 2 points.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# Dans ce cas, il y a action directe sur la chroma&lt;br /&gt;
&lt;br /&gt;
Vous pouvez agir sur l'effet souhaité avec Strength, mais aussi avec les autres fonctions notamment scope qui permet de délimiter l'action, par exemple en isolant une couleur parmi d'autres.&lt;br /&gt;
&lt;br /&gt;
*Le mode inverse, est maintenant doté de la fonction scope, il peut servir pour l'essentiel, à réaliser des dégradés (gradient), simulation de vignettage, ou de cadres dégradés, ou générer des effets spéciaux. Dans le cas de cadres dégradés, si vous sélectionnez -100 pour &amp;quot;lightness&amp;quot;, et réduisez la chrominance, et sélectionnez une valeur de &amp;quot;scope&amp;quot; supérieure à 75, la &amp;quot;bordure&amp;quot; sera noire.&lt;br /&gt;
&lt;br /&gt;
Il dispose de réglages spécifiques:&lt;br /&gt;
* Gamma (advanced): Modifie le gamma de Lab qui par défaut est à 3, pour le mettre linéaire si on souhaite travailler en mode HDR. Bien sûr un gamma inverse est appliqué en fin de ce processus;&lt;br /&gt;
* Spot structure : utilise l'algorithme de Sobel-Canny pour améliorer le delatE en prenant en compte les différences de structure;&lt;br /&gt;
* Blur shape detection : floute légèrement les résultats du delatE pour atténuer les éventuels artefacts.&lt;br /&gt;
====Courbes====&lt;br /&gt;
*Une courbe L=f(L) et une C=f(C) permet de moduler la luminance ou la chrominance pour chaque RT-spot (spot de contrôle) en fonction de la luminance ou de la chrominance (mode Standard). &lt;br /&gt;
*Une courbe L=f(H) (mode Advanced) permet de moduler la luminance pour chaque RT-spot en fonction de la teinte.&lt;br /&gt;
*Une courbe C=f(H) (mode Advanced) permet de moduler chrominance pour chaque RT-spot en fonction de la teinte. &lt;br /&gt;
*Une courbe H=f(H) (mode Advanced) permet de moduler la teinte pour chaque RT-spot en fonction de la teinte.&lt;br /&gt;
*Une courbe L=f(C) (mode Advanced) permet de moduler la luminance pour chaque RT-spot en fonction de la chrominance.&lt;br /&gt;
*Une courbe C=f(L) (mode Advanced) permet de moduler la chrominance pour chaque RT-spot en fonction de la luminance.&lt;br /&gt;
&lt;br /&gt;
Pour les rendre actives, il est nécessaire d'activer la combobox Curves type.&lt;br /&gt;
&lt;br /&gt;
Color &amp;amp; Light dispose entre autres de plusieurs améliorations (selon le niveau de complexité), par exemple: mask et structure.&lt;br /&gt;
&lt;br /&gt;
En mode &amp;quot;inverse&amp;quot; les courbes L=f(H) et H=f(H), L=f(C), C=f(L) ne sont pas implémentées ainsi que l’aperçu des modifications.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone curves (mode Advanced)&lt;br /&gt;
**En mode RGB vous disposez de 4 choix :  Standard, Weighted standard, Luminance, Film Like&lt;br /&gt;
**vous disposez d'une case à cocher &amp;quot;Special use of RGB curves&amp;quot; : de part la conception de &amp;quot;Local adjustements&amp;quot;, l'algorithme va comparer le résultat de RGB Tone curves avec l'original, ce qui dans certains cas peut fausser les attentes de l'utilisateur, notamment si on inverse la courbe par exemple pour créer un effet négatif. La case à cocher permet d'isoler le travail RGB Tone curves, supprimant toutes les autres actions: &amp;quot;Scope&amp;quot;, masques, curseurs...à l'exception des transitions. Si vous souhaitez utiliser cette image en la travaillant il suffit de créer un nouveau RT-spot au même endroit.&lt;br /&gt;
&lt;br /&gt;
====Fusion d'images (Merge Files)====&lt;br /&gt;
De manière assez similaire à Photoshop, vous pouvez fusionner 2 Rt-Spots ou 1 RT-spot avec un background.&lt;br /&gt;
* Avec 21 modes : Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* Et 3 curseurs pour contrôler l'action: Merge background (deltaE), Opacity, Contrast threshold.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Légèrement différent de celui du menu principal avec 3 curseurs identiques: Amount, Detail, Anchor, mais un mode d'action légèrement différent.&lt;br /&gt;
Il dispose en plus:&lt;br /&gt;
* Gamma : Modifie le gamma de Lab qui par défaut est à 3, pour le passer en mode linéaire si on souhaite travailler en mode HDR. Bien sûr un gamma inverse est appliqué en fin de ce processus;&lt;br /&gt;
* Spot structure : utilise l'algorithme de Sobel-Canny pour améliorer le delatE en prenant en compte les différences de structure;&lt;br /&gt;
* Blur shape detection : floute légèrement les résultats du delatE pour atténuer les éventuels artefacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure: dispose de l'amélioration &amp;quot;mask&amp;quot; (partiel en inverse)&lt;br /&gt;
&lt;br /&gt;
====Algorithmes PDE====&lt;br /&gt;
=====Contrast attenuator  (Ipol - modifié par jacques) =====&lt;br /&gt;
* Cet algorithme qui est un Atténuateur de contraste (ce n'est pas un Dynamic Range Compression) PDE possède 4 curseurs :&lt;br /&gt;
** Laplacian threshold qui réalise une convolution ignorant les valeurs inférieures au seuil&lt;br /&gt;
** Linearity qui permet d’accroître la luminance pour les valeurs inférieures à la moyenne&lt;br /&gt;
** Laplacian Balance qui équilibre le résultat en mélangeant le résultat PDE (Partial Differential Equation)  à standard (1 = 100% PDE)&lt;br /&gt;
** Gamma qui modifie la répartition de la Luminance avant et après le Laplacien. .&lt;br /&gt;
** le menu permet de choisir de débruiter ou non avant le Laplacien : la méthode utilisée (median) est assez destructrice, il est préférable d'utiliser le module Denoise (Blur/Gian &amp;amp; Denoise), soit Denoise agit avant (par défaut), soit après si on crée un RT-spot supplémentaire.&lt;br /&gt;
&lt;br /&gt;
PDE résout l'équation de Poisson (Laplacien + Fourier) après une transformée de Fourier.&lt;br /&gt;
&lt;br /&gt;
====Exposure (partie de Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
Ce module &amp;quot;ressemble&amp;quot; à celui en mode global RGB, mais :&lt;br /&gt;
* il fonctionne entièrement en mode L*a*b*, d'où des différences de rendu;&lt;br /&gt;
* il n'a pas les curseurs &amp;quot;lightness, chroma et contraste&amp;quot; dont les fonctions sont déjà présentes dans &amp;quot;Color &amp;amp; Light&amp;quot;;&lt;br /&gt;
* un curseur Chroma compensation est une particularité du mode L*a*b* : il permet d'éviter une variation de saturation apparente - le réglage par défaut devrait convenir dans une majorité de cas.&lt;br /&gt;
* un curseur supplémentaire &amp;quot;shadow&amp;quot; (Exposure Tools) qui utilise le même algorithme que &amp;quot;Shadows/Highlight &amp;amp; Equalizer&amp;quot;, mais limité à shadows et avec les paramètres par défaut : il utilise pour pondérer l'action en fonction de la luminance, le même curseur que celui des &amp;quot;shadows compression&amp;quot; , en effet soit ils sont exclusifs (black ou shadows), soit ils vont dans le même sens. Ce curseur supplémentaire &amp;quot;simplifie&amp;quot; l’usage pour l'utilisateur! &lt;br /&gt;
* il y a une seule courbe Contraste, similaire à celle de L=F(L) présente dans Color &amp;amp; Light. Il est évident que le rendu de cette courbe est différent de Tonecurve qui agit en mode RGB. Vous pouvez si vous le souhaitez activer les 2 courbes L=f(L) dans Color &amp;amp; Light et Exposure. &lt;br /&gt;
* ne pas hésiter à utiliser modérément &amp;quot;highlight compression&amp;quot; qui améliorera la sélection. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shadows/Highlight &amp;amp; Equalizer est une alternative possible, notamment si le RT-spot est dans une zone d'ombre importante. &lt;br /&gt;
&lt;br /&gt;
* Remarque : éviter de placer le Spot dans des parties à très faible luminance, les résultats peuvent être inattendus&lt;br /&gt;
&lt;br /&gt;
Conseils :&lt;br /&gt;
* '''cet algorithme est peu performant''', mais les utilisateurs ont l'habitude de l'utiliser. j'ai été amené à mettre en place des palliatifs pour le rendre convenable;&lt;br /&gt;
* lui préférer (il y en a d'autres, voir dans Premiers pas):&lt;br /&gt;
** Tone Equalizer - dans Shadows/Highlight &amp;amp; Tone Equalizer;&lt;br /&gt;
** Tone Response Curve (TRC) - lui aussi dans dans Shadows/Highlight &amp;amp; Tone Equalizer (Equalizer en mode &amp;quot;Standard&amp;quot;). N'hésitez pas à accroître &amp;quot;Slope&amp;quot; pour déboucher linéairement les ombres. Vous pouvez agir sur le gamma pour éclaircir les zones claires.&lt;br /&gt;
&lt;br /&gt;
===Shadows Highlight&amp;amp; Tone Equalizer===&lt;br /&gt;
Exemple d'utilisation Shadows/Highligt - Tone Equalizer - Tone Response Curve(TRC): [[Local Lab controls/fr#Cinq manières de changer l'exposition - relever les ombres| Exemple dans Premiers pas d'utilisation]]&lt;br /&gt;
&lt;br /&gt;
Pour l'ensemble du module :&lt;br /&gt;
* Est doté de Graduated Filter (Standard / Advanced) et de Recovery based on Luminance mask&lt;br /&gt;
* Dans les cas d'importants débouchage des ombres, l'utilisation de Denoise (Blur/Grain &amp;amp; Denoise) peut être nécessaire.&lt;br /&gt;
&lt;br /&gt;
====Shadows Highlight====&lt;br /&gt;
* Seul le mode &amp;quot;L*a*b*&amp;quot; est disponible.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
Ce module Tone Equalizer(origine Darktable - transformé pour Rawtherapee par Alberto Griggio) permet une retouche progressive des Tons en fonction de l'exposition (en EV)&lt;br /&gt;
* 5 curseurs du plus sombre au plus clair, plus un curseur Detail  permettent un travail fin sur la luminance, par exemple ne déboucher que les ombres très prononcée -16 ou -18EV&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
Avec ce module vous pouvez retoucher le gamma et la pente (slope) de l'image:&lt;br /&gt;
* j'ai mis une TRC plutôt qu'un simple gamma / slope pour réduire les artefacts et avoir une meilleure restitution des couleurs&lt;br /&gt;
* par défaut le réglage : Gamma 2.4 et Slope 12.92 (gamma sRGB) correspond à celui mis en œuvre en sortie par défaut dans Rawtherapee (profil d'écran, ou sRGB). Rappel tout le traitement de Rawtherapee est réalisé avec un gamma de 1.&lt;br /&gt;
* Essayez d'autres réglages qui donnent un image semblable mais agissent différemment sur les ombres et les lumières&lt;br /&gt;
** BT709 : gamma 2.22 slope 4.5&lt;br /&gt;
** Lab : gamma 3.0 slope 9.02&lt;br /&gt;
* Ce module permet d'agir sur:&lt;br /&gt;
** lumières avec Gamma: n'hésitez pas à utiliser de grandes valeurs pour gamma, si nécessaire&lt;br /&gt;
** basses lumières avec Slope: n'hésitez pas à utiliser de grandes valeurs pour slope, si nécessaire&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/cool===&lt;br /&gt;
Pour l'ensemble:&lt;br /&gt;
* Possibilité de masques en mode standard et advanced.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance en mode Standard&lt;br /&gt;
** Luminance, Chroma, Hue en mode Advanced&lt;br /&gt;
* Recovery based on Luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Module similaire à celui du menu principal.&lt;br /&gt;
&lt;br /&gt;
====Warm - Cool====&lt;br /&gt;
Un curseur permet :&lt;br /&gt;
*de faire varier la &amp;quot;chaleur&amp;quot; de la zone sélectionnée.&lt;br /&gt;
*de réduire ou supprimer certains artefacts de couleurs, par exemple dus à de multiples illuminants,...&lt;br /&gt;
&lt;br /&gt;
A noter que l'algorithme ne correspond pas à une balance des blancs - même si cela en a l'apparence. L'algorithme utilise une partie de CIECAM02, le processus CAT02 qui est probablement la meilleure adaptation chromatique disponible.&lt;br /&gt;
Par rapport à la référence D50, lorsque vous souhaitez réchauffer l'image, le curseur va au contraire abaisser la température des &amp;quot;viewings conditions&amp;quot;, et bien sûr l'accroître lorsque vous souhaitez &amp;quot;refroidir&amp;quot; la zone concernée.&lt;br /&gt;
A noter que vous pouvez  obtenir un résultat similaire pour l'image entière en utilisant le module CIECAM02, avec : &lt;br /&gt;
* Scene conditions : WP model  ==&amp;gt; free temp + green + cat02, temperature = 5000K, Surround = average, CAT02 adpatation = 100, Yb=18, Scene absolute luminance = 400&lt;br /&gt;
* aucun réglage dans &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing conditions : CAT02 adaptation = 100, Viewing absolute luminance = 400, Surround = average, Yb=18, et bien sûr réglage de la température souhaitée.&lt;br /&gt;
&lt;br /&gt;
===Local contrast &amp;amp; Wavelet===&lt;br /&gt;
Vous disposez de 2 options:&lt;br /&gt;
* Unsharp mask : l'algorithme est similaire à celui du menu principal&lt;br /&gt;
* Wavelet (mode standard ou advanced) : l'algorithme est proche de celui du menu principal, mais sans Denoise (qui est un module séparé dans Local Adjustments). Les fonctions sont similaires mais plus performantes (notamment en mode advanced) et bénéficient du DeltaE.  &lt;br /&gt;
** en mode standard :l'algorithme correspond à une utilisation - simplifiée - du module wavelets, Local contrast &amp;amp; wavelets, combinant un algorithme proche de Final contrast local et Contraste pour l'image résiduelle. Il permet ainsi de réaliser une fonction Clarity.&lt;br /&gt;
** en mode advanced: 2 expanders Wavelet pyramid 1 &amp;amp; 2, abritent divers outils, permettant:&lt;br /&gt;
*** contraste par niveau, Tone mapping, Directional contrast &lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur&lt;br /&gt;
&lt;br /&gt;
Pour les 2 modules possibilités de masques et Recovery based on Luminance mask en modes Standard et Advanced&lt;br /&gt;
&lt;br /&gt;
====Unsharp mask====&lt;br /&gt;
Rendu différent du fait de la position dans le processus.&lt;br /&gt;
&lt;br /&gt;
Une case à cocher Use Fast Fourier a été ajoutée, elle permet d'utiliser la transformée rapide de Fourier, pour générer le flou (blur) nécessaire à Local contrast.&lt;br /&gt;
*La formule utilisée est la formule de Gauss qui s'applique après la transformée et avant la transformée inverse. &lt;br /&gt;
*formule de Gauss G(x,y) = (1/2*PI*sigma) * exp(-(x2 + y2) / 2* sigma2). &lt;br /&gt;
* version adaptée à Fourier : G(x,y) =  exp((-sigma)*(PI * x2 + PI * y2))&lt;br /&gt;
Cette formule par définition est exacte quelque soit le rayon sigma.&lt;br /&gt;
&lt;br /&gt;
A noter la différence de rendu avec la fonction utilisée dans Rawtherapee qui utilise une série de formules approximatives.&lt;br /&gt;
&lt;br /&gt;
La FFT (Fast Fourier Transform) a un temps de traitement qui ne dépend que la surface a traiter, l'application de la fonction de Gauss, est quasi instantanée et indépendante du rayon.&lt;br /&gt;
A noter l'optimisation de la FFT lorsque les dimensions (H, W) de la zone correspondent à la décomposition en facteurs premiers et uniquement ceux-ci. 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (avec a + b = 0 ou 1), et malgré l'optimisation les temps de traitement peuvent être importants.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
Un exemple simple (pas avec Pyramid) d'utiliser Wavelets: [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Vous disposez:&lt;br /&gt;
=====Sélecteur de niveaux=====&lt;br /&gt;
* un sélecteur de level (niveau) avec seuil qui permet de sélectionner une plage de niveaux et non un simple niveau maximum - l'algorithme réduit automatiquement le niveau si l'espace disponible (taille du spot - ou dimension du preview) est insuffisante : au niveau 9, il faut au minimum 1024 pixels, au niveau 8 - 512, au niveau 7 - 256, au niveau 6 -128, au niveau 5 - 64, au niveau 4 - 32, au niveau 3 - 16, au niveau 2 - 8, au niveau 1 - 4, au niveau 0 -2&lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* une courbe Local contrast qui agit sur le contraste (luminance), attention on n'agit pas directement sur la luminance mais sur les décompositions. Cette première courbe prend en compte la luminance de l'image non décomposée et les niveaux de décomposition de 0 à 9 (les hauts niveaux ne sont possibles que si la taille du RT-Spot le permet et que les dimensions du &amp;quot;Preview&amp;quot; sont suffisantes). &lt;br /&gt;
* cette courbe, plus le sélecteur de niveaux va permettre de modifier le micro-contraste en fonction de la luminance, par exemple renforcer ce contraste dans les moyennes lumières, abaisser le contraste dans les ombres. Bien sûr, si nécessaire vous pouvez ajouter un autre RT-spot avec d'autres réglages...&lt;br /&gt;
=====Image résiduelle=====&lt;br /&gt;
* un curseur qui agit sur le contraste de l'image résiduelle&lt;br /&gt;
* un curseur qui agit sur la saturation (chroma) de l'image résiduelle&lt;br /&gt;
* 4 curseurs qui permettent d'agir sur shadows/highlight de l'image résiduelle, avec la possibilité d'entrer des valeurs négatives.&lt;br /&gt;
* 2 curseurs Gamma et Slope permettent d'ajuster les ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask et Blend &amp;amp; Soft Images (détails) =====&lt;br /&gt;
* c'est le sélecteur de niveaux qui permet de choisir entre Clarity et Sharp mask, pour les valeurs inférieures ou égales à 4 Sharp Mask, pour 5 et au dessus Clarity&lt;br /&gt;
* Merge Luma permet de sélectionner l'intensité de l'effet recherché sur la luminance.&lt;br /&gt;
* Merge chroma permet de sélectionner l'intensité de l'effet recherché sur la chroma.&lt;br /&gt;
* Merge only with original image, empêche de mélanger l'ensemble des actions Wavelets pyramid et préserve ainsi la possibilité de Clarity et Sharp mask, sans interférences&lt;br /&gt;
* attention, Merge Luma et Merge chroma, mélangent l'ensemble du processus Wavelets, qui peut se limiter à Clarity (voir ci-dessus).&lt;br /&gt;
* Soft radius&lt;br /&gt;
** un slider Soft radius (algorithme GuidedFilter) permet de réduire les halos et les irrégularités aussi bien pour Clarity et Sharp Mask que pour l'ensemble des processus de Wavelet pyramid. Pour désactiver, mettre à zéro&lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
Gamma : Modifie le gamma de Lab qui par défaut est à 3, pour le mettre linéaire si on souhaite travailler en mode HDR. Bien sûr un gamma inverse est appliqué en fin de ce processus.&lt;br /&gt;
&lt;br /&gt;
=====Wavelets Pyramids - 2 expanders=====&lt;br /&gt;
======Graduated filter &amp;amp; Local contrast======&lt;br /&gt;
*  permet de faire varier le contraste local en fonction d'un gradient souhaité et d'un angle. Ce qui est pris en compte est la variation du signal Luminance (et non la luminance)&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
Ce module comporte les mêmes réglages et finalités que celui du module principal dans &amp;quot;main wavelets&amp;quot;, c'est à dire qu'il est complexe!&lt;br /&gt;
Il vise à cibler l'action du contraste local sur les bords et utilise les mêmes réglages&lt;br /&gt;
* [[Wavelets/fr#Bords_Nettet.C3.A9_.28luminance.29_et_Clart.C3.A9|bords netteté]]&lt;br /&gt;
Bien sûr il bénéficie en plus des particularités de &amp;quot;Local adjustements&amp;quot; (scope, transition, sélections multiples,...)&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* Blur residual : permet de flouter l'image résiduelle, essayez avec des valeurs différentes du sélecteur de niveaux. Les valeurs intermédiaires du sélecteur de niveaux (Top right,  Bottom right) peuvent amener des résultats curieux.&lt;br /&gt;
* Blur levels : permet de flouter n'importe quel niveau ou plage de niveaux. L'abscisse du graphique représente le level de la décomposition en ondelettes. La partie gauche correspond aux faibles valeurs 2, 4, 8 pixels. Le curseur supérieur permet de fixer le maximum de flou, quelque soit les positions du sélecteur de niveaux. Chroma levels agit en pourcentage en plus ou en moins de la luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by levels====== &lt;br /&gt;
* est le pendant de Contrast By Details Levels, mais aussi du module Contrast de Wavelet main. Là encore la courbe représente en abscisse les niveaux de décomposition, et en ordonnée l'amplification ou la réduction du signal. &lt;br /&gt;
* Attenuation response, permet de choisir l'étendue de la zone impactée, autour de la valeur moyenne du signal.&lt;br /&gt;
* Offset : déplace l'action centrale du système vers les basses ou hautes luminances &lt;br /&gt;
* Chroma levels : agit sur les composantes &amp;quot;a&amp;quot; et &amp;quot;b&amp;quot; de L*a*b* en pourcentage d'action de la luminance.&lt;br /&gt;
Avec ce module, vous pouvez - combiné ou non avec la courbe Local contraste luminance, renforcer ou atténuer des détails - contraste apparent.&lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
Vous pouvez opérer un Tone mapping avec ce module.&lt;br /&gt;
Il agit sur la différence entre les 3 directions de décomposition : horizontale, verticale et diagonale&lt;br /&gt;
Le processus joue sur l'écart entre diagonal et le coupe horizontal / vertical. Ceci permet d'agir sur l'effet de bord (edge).&lt;br /&gt;
La courbe agit en fonction de la luminance.&lt;br /&gt;
* Attenuation response : permet de contrôler l'action au plus proche des contrastes moyens, en réduisant l'action sur les faibles et fort contrastes (étendue de la zone impactée). L'accroître va augmenter l'action en dehors des contrastes moyens.&lt;br /&gt;
* Delta balance: permet d'agir selon la valeur positive ou négative, plutôt sur les niveaux élevés (levels) ou les niveaux faibles.&lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Exemple pour accroître la texture : [[Local Lab controls/fr#Trois manières d'accroître la texture| Exemple dans Premiers pas - accroître la texture avec Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
Ce module ne fait intervenir que l'outil Wavelet avec une compression (ou décompression) qui peut toucher chaque niveau de décomposition et l'image résiduelle. L’atténuation des artefacts dus à la recomposition est assurée par un Guided Filter (voir ci-dessous). &lt;br /&gt;
* Attenuation response : permet de contrôler l'action au plus proche des contrastes moyens, en réduisant l'action sur les faibles et fort contrastes (étendue de la zone impactée). L'accroître va augmenter l'action en dehors des contrastes moyens.&lt;br /&gt;
* Balance Threshold: (défaut 1.4) permet un équilibrage de l'action, autorisant dans certains cas aux ombres d'être débouchées&lt;br /&gt;
** Les valeurs négatives assurent la compression des données et donnent un rendu Tone mapping, différent des opérateurs habituels (Mantiuk, Fattal...); il sera plus sensible - par conception - aux différents niveaux de contraste local, et moins sensible pour traiter les aplats.&lt;br /&gt;
** Les valeurs positives servent à réduire le contraste apparent et permettent des effets similaires à Original Retinex. Ils sont une alternative à Dodge and burn.&lt;br /&gt;
** Compress residual image : accroît ou réduit le contraste de l'image résiduelle.&lt;br /&gt;
* il est recommandé, pour réduire les artefacts, d'utiliser si nécessaire  Clarity and Sharp mask - Blend &amp;amp; Soft images, en ajustant la valeur de &amp;quot;Soft radius&amp;quot; qui est à 1 par défaut (faible valeur convenant dans une majorité de cas)&lt;br /&gt;
&lt;br /&gt;
=====Commentaire=====&lt;br /&gt;
* n'oubliez pas que vous pouvez utiliser Scope pour cibler l'action et/ou Excluding spot pour annuler une action sur une zone choisie, notamment avec &amp;quot;Levels dynamic Range Compression&amp;quot; pour annuler des ombres trop prononcées.&lt;br /&gt;
&lt;br /&gt;
=====Importance de Attenuation response=====&lt;br /&gt;
Agit sur l'écart type (même si la distribution n'est pas du tout Gaussienne, mais c'est une modélisation). Pour la quasi totalité des algorithmes Wavelet pyramid, la prise en compte pour chaque niveau de la moyenne, de l'écart type, du maximum, permet de traiter la décomposition d'une manière non linéaire afin d'éviter les artefacts.&lt;br /&gt;
Les valeurs de micro-contraste proche de la moyenne subissent une amplification plus importante que les basses et hautes valeurs.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Exemple d'utilisation pour accroître la texture :[[Local Lab controls/fr#Trois manières d'accroître la texture| Exemple dans Premiers pas - accroître la texture avec Tone mapping ]] &lt;br /&gt;
 &lt;br /&gt;
* Possibilité de masque et Recovery based on Luminance mask en modes Standard et Advanced.&lt;br /&gt;
* Ajout d'un slider saturation (formule de Mantiuk quelquefois insuffisante)&lt;br /&gt;
* Strength est renommé en Compression strength - sa vraie fonction:les réglages possibles sont différents / Lab adjustments -1 à 2 / Local adjustments -0.5 à 2 &lt;br /&gt;
* Gamma: les réglages possibles sont différents / Lab adjustments 0.8 à 1.5 / Local adjustments 0.4 à 4&lt;br /&gt;
* Reweighting Iterates : les réglages possibles sont différents / Lab adjustments 0 à 9/ Local adjustments 0 à 3  &lt;br /&gt;
* ajout d'une Checkbox : Normalize luminance. Dans le cas activé, l'image finale a la même moyenne et la même variance que l'image initiale.&lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associé à &amp;quot;scope&amp;quot; permet de réaliser - entre autres -une fonction clarté (clarity), limitée à une zone d'action.&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light est identique à celui du menu principal&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Un exemple d'utilisation:[[Local Lab controls/fr#Comment réaliser un Dodge and burn (Éclaircir et brûler)| Exemple dans Premiers pas de Dodge and burn - éclaircir et bruler]]&lt;br /&gt;
&lt;br /&gt;
Après essais, j'ai tenu à ajouter - exclusivement en mode local, l'algorithme original de Retinex (origine Ipol).&lt;br /&gt;
Cet algorithme est différent de ceux utilisés par ailleurs, y compris dans Rawtherapee. Il essaie de traduire la perception de l’œil lorsque il y a des ombres et des variations de luminance; perception de l’œil qu'un capteur photographique a du mal à rendre. Par exemple pour un portrait au flash ou en lumière forte le visage verra souvent apparaître des zones ombre ou lumineuse trop accentuées - qu'on pallie quelquefois avec des fonctions telles &amp;quot;dodge&amp;quot; and &amp;quot;burn&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Il peut dans certains cas remplacer cette fonction &amp;quot;dodge&amp;quot; and &amp;quot;burn&amp;quot; qui dans certains logiciels indiquent avec une brosse les endroits à assombrir ou éclaircir. Dans le cas de ce Retinex original PDE cette opération est automatique.&lt;br /&gt;
&lt;br /&gt;
Je me suis servi du code trouvé sur &amp;quot;Ipol&amp;quot; https://www.ipol.im/pub/art/2011/lmps_rpe/  que j'ai modifié et adapté à Rawtherapee et au &amp;quot;contrôle local&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Cet algorithme complexe se décompose en plusieurs étapes:&lt;br /&gt;
* lecture de l'image&lt;br /&gt;
* utilisation d'un Laplacien discret avec seuil qui permet de déterminer l'intensité du Laplacien : les valeurs de &amp;quot;strength&amp;quot; aux environs de 70 amènent un &amp;quot;threshold&amp;quot; interne du Laplacien aux environs de &amp;quot;4&amp;quot; (référence habituelle des transformées de Laplace). Ce Laplacien va éliminer les petites variations de luminance inférieures au &amp;quot;threshold&amp;quot;&lt;br /&gt;
* Le curseur &amp;quot;Laplace threshold deltaE&amp;quot; permet une différenciation du seuil du Laplacien selon le deltaE. Sous la valeur sélectionnée un Laplacien &amp;quot;plein effet&amp;quot; est choisi, au dessus de la valeur un 2ème Laplacien 60% plus faible est combiné avec le premier. Cette action est différente de celle de &amp;quot;scope&amp;quot; qui réduit l'action mais globalement. Ceci permet de mieux séparer l'avant-plan de l'arrière plan.&lt;br /&gt;
* création d'une transformée de Fourrier - 2 dimensions (DCT: Discrete Cosinus Transform)&lt;br /&gt;
* résolution de l'équation de Poisson (PDE)  pour &amp;quot;équilibrer&amp;quot; le système&lt;br /&gt;
* transformée inverse de Fourrier - 2 dimensions&lt;br /&gt;
* normalisation de la luminance par rapport à l'image d'origine : même moyenne et même écart-type.&lt;br /&gt;
&lt;br /&gt;
Vous pouvez avoir un aperçu du processus avec le menu &amp;quot;Show process Fourier&amp;quot; qui permet de voir les différentes étapes;&lt;br /&gt;
# création du Laplacien variable (1ère étape)&lt;br /&gt;
# transformée de Fourier (DCT : discrete cosinus transform) de ce Laplacien&lt;br /&gt;
# résolution de l'équation de Poisson (PDE : Poisson discrete equation) sous la décomposition de Fourier : notez la relative proximité de cette image (sous sa forme Fourier) et celle du Laplacien&lt;br /&gt;
# transformée inverse - non visible dans cet aperçu... mais vous avez le résultat final!&lt;br /&gt;
# normalisation de la luminance (ici &amp;quot;absence de&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
A tester, notamment dans les portraits...&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze est similaire à celui de main, mais peut être associé à Retinex pour de meilleurs résultats.&lt;br /&gt;
====Retinex : Avertissement important====&lt;br /&gt;
Exemple d'utilisation pour accroître la texture : [[Local Lab controls/fr#Trois manières d'accroître la texture | Exemple dans Premiers pas - accroître la texture avec Retinex]]&lt;br /&gt;
&lt;br /&gt;
Dans Local adjustments, Retinex est proche de celui de &amp;quot;main&amp;quot;, mais avec des différences.&lt;br /&gt;
&lt;br /&gt;
Retinex exige de sévères conditions pour fonctionner de manière optimale. Il est indispensable d'avoir l'étendue nécessaire pour mettre en œuvre les très importants rayons de flou gaussien.&lt;br /&gt;
L'architecture de Rawtherapee ne permet pas dans le &amp;quot;preview&amp;quot; d'avoir dans tous les cas les conditions qui permettent cette mise en œuvre. En conséquence il y aura des différences entre l’aperçu à l'écran et la sortie &amp;quot;TIF ou JPG&amp;quot;.&lt;br /&gt;
Ces différences sont d'autant plus importantes que:&lt;br /&gt;
* le spot est de petite taille;&lt;br /&gt;
* les valeurs de scale sont élevées;&lt;br /&gt;
* &amp;quot;radius&amp;quot; est important.&lt;br /&gt;
&lt;br /&gt;
L'algorithme &amp;quot;pleine image&amp;quot; n'est pas soumis à ces restrictions !&lt;br /&gt;
&lt;br /&gt;
De plus la quantité de ressources consommées, mémoire, temps de traitement augmente avec :&lt;br /&gt;
* la taille du spot&lt;br /&gt;
* radius, élevé&lt;br /&gt;
* scale, élevé&lt;br /&gt;
* utilisation de masques&lt;br /&gt;
* utilisation de FFTW&lt;br /&gt;
&lt;br /&gt;
On peut facilement atteindre des valeurs de 6 ou 8 GB ou plus de mémoire consommée !&lt;br /&gt;
Par exemple une image de D850 : 8280*5512 -&lt;br /&gt;
Retinex : spot au delà des limites de l'image, Radius = 500, Scale = 10, pas de masques, aboutit à plus de 9GB nécessaires !!&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
Une case à cocher Use Fast Fourier, a été ajoutée, elle permet d'utiliser la transformée rapide de Fourier, pour générer le flou (blur) nécessaire à Multi Scale Retinex.&lt;br /&gt;
Elle s'accompagne d'un accroissement notable du temps de traitement, mais d'un gain en qualité pour les grands rayons&lt;br /&gt;
&lt;br /&gt;
====Fonctionnalités====&lt;br /&gt;
J'ai apporté des modifications suivantes:&lt;br /&gt;
* à l'interface GUI;&lt;br /&gt;
* ajouté un curseur à Dehaze (depth), alors que auparavant il était calculé à partir des paramètres Retinex &lt;br /&gt;
* ajouté une case à cocher pour choisir entre mode 'linéaire' qui me semble approprié pour travailler sur le contraste et mode &amp;quot;logarithm&amp;quot; plus approprié pour réduire la brume, mais qui permet aussi des effets sur le contraste local plus importants, mais &amp;quot;logarithm&amp;quot;  peut apporter ou accroître un effet de halo.&lt;br /&gt;
* ajouté une courbe Transmission Map qui permet d'agir en interne sur la Transmission et réduire les artefacts&lt;br /&gt;
* ajouté l'affichage des données liées à Transmission map et aux données reconstituées&lt;br /&gt;
* ajouté un curseur Clip Restored Data, qui permet d'ajuster - conjointement avec Threshold et aussi Offset, les valeurs affichées de Transmission Map. &lt;br /&gt;
* ajouté un curseur Reduce artifact deltaE, qui agit sur les données juste après les actions sur &amp;quot;transmission map&amp;quot;&lt;br /&gt;
* changé les paramètres par défaut&lt;br /&gt;
* séparé (au niveau du GUI et en partie au niveau de l'algorithme) la place de Dehaze : &lt;br /&gt;
** dans &amp;quot;main&amp;quot; ce sont 2 algorithmes séparés (séparation liée à l'historique de l'élaboration de chacun des algorithmes), alors qu'ils visent en partie une même finalité, atténuer la brume.&lt;br /&gt;
** dans &amp;quot;Local adjustments&amp;quot;, ils sont réunis dans la même interface, pour mieux profiter des points forts de chacun des 2 algorithmes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Le nombre de réglages est différent, par rapport au mode &amp;quot;main&amp;quot;. D'autre part, Retinex local, agit en fin de processus contrairement au mode standard qui est au début du processus Raw.&lt;br /&gt;
Vous disposez en plus du module &amp;quot;raw&amp;quot; Retinex (main):&lt;br /&gt;
* le module dehaze, Dehaze &amp;amp; Retinex (qui utilise l'algorithme dehaze pleine image). La combinaison des 2 algorithmes de réduction du voile atmosphérique (Retinex et Dehaze) permet une résolution élevée du traitement du voile atmosphérique, chacun des algorithmes ayant ses points forts - en particulier Retinex permet de différencier avant et arrière plan et Dehaze est globalement plus facile et pertinent dans l'action.&lt;br /&gt;
* Par défaut Dehaze est en mode L*a*b*, sauf si vous cochez &amp;quot;Luminance only&amp;quot;&lt;br /&gt;
L'algorithme Retinex n'est utilisé que si Strength Retinex est supérieur à 0.2&lt;br /&gt;
* Si vous choisissez scale=1, l'algorithme &amp;quot;Retinex&amp;quot; est partiellement court-circuité et le process se comporte comme &amp;quot;local contrast&amp;quot; mais avec des valeurs de réglages nettement plus importants - certaines fonctionnalités ont disparues ou changées (masques, Tone mapping...), d'autres ont des réglages différents (radius, variance, Threshold).   &lt;br /&gt;
* Darkness et Lightness sont sans effet lorsque la valeur  1 est choisie. Dans les autres cas, la dernière étape de Multiple scale Retinex se voit appliquée un algorithme proche de &amp;quot;local contrast&amp;quot;, ces 2 curseurs, associés à &amp;quot;Strength&amp;quot; vont permettre de jouer en amont sur le contraste local.&lt;br /&gt;
* les autres sélections possibles : Méthode : low, uniform, high, Strength, Radius, Threshold, Contrast, ont un principe similaire à ceux du module principal, même si certains réglages et effets induits sont un peu différents. &lt;br /&gt;
* ajout d'une checkbox : Normalize luminance. Dans le cas activé, l'image finale a la même moyenne et la même variance que l'image initiale.&lt;br /&gt;
&lt;br /&gt;
Possibilité de masques (uniquement pour Retinex) dont le fonctionnement est globalement similaire aux autres masques, mais qui a ses particularités - notamment d'être incorporé au processus Retinex avec la possibilité, soit d'être élaborés juste au début du traitement, soit à la fin prenant en compte &amp;quot;transmission map&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Par exemple pour traiter une image fortement brumeuse:&lt;br /&gt;
* en première étape agir dans le menu principal avec la fonction Dehaze, dans certains cas l'arrière plan ne sera pas ou peu impacté et restera brumeux&lt;br /&gt;
* puis sélectionner Retinex, positionner le spot dans la zone brumeuse puis &lt;br /&gt;
** agir sur Dehaze&lt;br /&gt;
** puis généralement régler radius, avec une  valeur élevée (supérieure à 100 ou 150, mais des valeurs inférieures peuvent convenir)&lt;br /&gt;
** régler généralement variance (contraste) avec une valeur faible (inférieure à 100, mais des valeurs supérieures peuvent convenir)&lt;br /&gt;
** régler scale sur 3 ou plus. Plus les valeurs seront élevées, plus variance pourra être élevée et réduire ainsi les artefacts.&lt;br /&gt;
** agir sur scope, strength et chroma pour obtenir l'effet souhaité.&lt;br /&gt;
&lt;br /&gt;
Les résultats sont la plupart du temps assez imprédictibles, par exemple certaines images seront peu sensibles au curseur Threshold, d'autres très sensibles...&lt;br /&gt;
Mais globalement ce module à deux usages essentiels - avec des réglages différents :&lt;br /&gt;
* traiter les images brumeuses.&lt;br /&gt;
* réaliser un contraste local avec des valeurs importantes, avec possibilité de simuler &amp;quot;Clarity&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
=====Maîtriser les artefacts et le halo=====&lt;br /&gt;
Retinex est très performant, mais : a) complexe, b) il peut générer des artefacts notamment aux zones de transition de luminance, c) il peut généralement produire du halo&lt;br /&gt;
&lt;br /&gt;
Pour réduire artefacts et halos, une fois les réglages de base choisis (Radius, variance, scale, darkness, transmission gain...et strength)&lt;br /&gt;
* Utiliser le tableau de bord des données Transmission map.&lt;br /&gt;
* agir sur Clip Restored datas, Offset, ainsi que sur Threshold pour obtenir des valeurs de Restored datas, Min et Max proches respectivement de 0 et 32768. Attention d'autres valeurs peuvent convenir, mais il est important que les ordres de grandeurs soient respectées, par exemple éviter des valeurs telles que Min = -25000 et Max = 90000&lt;br /&gt;
* si les artefacts persistent, agir sur la courbe Transmission map et abaisser la partie proche du milieu de l'abscisse (qui correspond à la moyenne des données), vous pouvez également essayer de modifier les parties Max et min de l'abscisse (peut être en rehaussant min et abaissant max)&lt;br /&gt;
* vous pouvez aussi agir sur la courbe Transmission gain.&lt;br /&gt;
*vous pouvez également agir sur Reduce deltaE artifacts, en accroissant la valeur par défaut (vous pouvez également agir sur Scope)&lt;br /&gt;
* vous pouvez déplacer le Rt-spot pour changer les valeurs de référence&lt;br /&gt;
*bien sûr vous pouvez modifier les réglages de base et recommencer la démarche !&lt;br /&gt;
* vous pouvez vous aider d'un masque notamment sur la luminance en privilégiant le mode Use transmission map, et agir sur les paramètres de fusion (Blend, radius, etc.)&lt;br /&gt;
&lt;br /&gt;
Certes c'est complexe, mais les images obtenues notamment pour travailler sur le contraste local peuvent être très belles.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Seul le mode RL deconvolution, est proposé, vous devez travailler en mode 1:1 (zoom 100%) .&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* zone minimum d'action : 64x64 pixels - mais vous pouvez utiliser conjointement les propriétés de &amp;quot;Transition&amp;quot; pour réduire la zone d'action.&lt;br /&gt;
* à utiliser de préférence en mode 1:1 (zoom 100%)&lt;br /&gt;
* pas de curseurs pour la gestion de la peau; le système utilisé par les RT-spot le remplace.&lt;br /&gt;
* ajout d'un curseur pour la chroma&lt;br /&gt;
* ajout de Image résiduelle, avec 2 possibilités - Clarity - et contraste&lt;br /&gt;
&lt;br /&gt;
Masque et Revovery based on luminance mask, en mode normal et advanced.&lt;br /&gt;
&lt;br /&gt;
Cet algorithme permet plusieurs améliorations locales.&lt;br /&gt;
* par exemple réduire les défauts de la peau&lt;br /&gt;
* accroître les perspectives et le relief sur des zones de couleurs et de structure (comme le wavelet), mais en limitant l'action (par scope) à des zones délimitées.&lt;br /&gt;
* retirer des défauts (tâches étendues grises ou de couleurs) sur le capteur&lt;br /&gt;
&lt;br /&gt;
Rappel - si la zone sélectionnée est grande et comprends plusieurs objets similaires en &amp;quot;teinte&amp;quot;, &amp;quot;chroma&amp;quot;, luma&amp;quot; et 'contrast&amp;quot;, l'algorithme ne sélectionnera que celles-ci, laissant le reste de l'image inchangée.&lt;br /&gt;
&lt;br /&gt;
===Blur/grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* Pour ces 3 modules vous avez  le choix entre travailler en mode Luminance only, Chrominance only, ou Luminance + chrominance&lt;br /&gt;
&lt;br /&gt;
Vous avez le choix entre 3 méthodes:&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius :un filtre gaussien est appliqué (vous pouvez choisir d'utiliser en sortie TIF/JPG) une transformée de Fourier (FFT), Blur n'est actif que si Radius supérieur ou égal à 1.6; En réduisant notablement la valeur par défaut de &amp;quot;scope&amp;quot; et en agissant éventuellement sur Luminance only il est possible d'obtenir des flous différenciés selon la teinte&lt;br /&gt;
* Noise : du bruit de luminance est ajouté à l'image;&lt;br /&gt;
&lt;br /&gt;
* '''Film Grain''' :  &lt;br /&gt;
** Coarseness : avec 2 réglages &lt;br /&gt;
*** Distribution : simule le nombre ISO&lt;br /&gt;
*** Gamma : change la répartition, les hautes valeurs accroissent les effets&lt;br /&gt;
** Strength : règle l'intensité&lt;br /&gt;
** Scale : par défaut à 100... &lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
* vous pouvez choisir entre 3x3, 5X5, 7X7, 9X9 et le nombre de passes de 1 à 4 (ces medians sont directement dérivés de ceux de Denoise)&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* vous pouvez sélectionner Soft radius, Strength et detail, l'ensemble agit sur l'impression de force. Ce module peut venir en complément de denoise.&lt;br /&gt;
&lt;br /&gt;
=====Action en complément de Denoise=====&lt;br /&gt;
Vous pouvez utiliser ce module, notamment Median et Guided filter en complément de Denoise dans les cas délicats&lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Exemple d'utilisation de Denoise : [[Local Lab controls/fr#Comment utiliser le module &amp;quot;Denoise&amp;quot;| Exemple dans Premiers pas d'utilisation de Denoise]]&lt;br /&gt;
&lt;br /&gt;
Ce module est vraiment différent du module &amp;quot;main&amp;quot;, pour plusieurs raisons:&lt;br /&gt;
* il est équipé d'un module Non-Local means ou débruitage par morceaux qui ne concerne que le bruit de luminance.&lt;br /&gt;
* même si il utilise les mêmes fonctions de base Wavelets que &amp;quot;mean&amp;quot; celles-ci ont été modifiées afin de pouvoir élever le niveau de décomposition :&lt;br /&gt;
** passer de 5 (0 à 4) niveaux à 7 (0 à 6) pour la luminance , ce qui permet un débruitage différent, notamment dans les aplats (mais va nécessiter plus de ressources).&lt;br /&gt;
** passer de 6 (0 à 5) niveaux à 7 (0 à 6) pour la chrominance, &lt;br /&gt;
* il est doté de fonctions supplémentaires:&lt;br /&gt;
** l'algorithme DCT (Discrete Cosinus Transform) est étendu à la composante chrominance&lt;br /&gt;
** vous pouvez conjuguer les actions de Wavelets, avec d'autres outils par exemple, pour les cas délicats : Guided Filter qui va agir un peu à la manière d'un filtre bilatéral notamment pour la dimension &amp;quot;chrominance&amp;quot;&lt;br /&gt;
* Deux Expanders permettent une action sur le bruit de luminance à partir des informations contenues dans le masque:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
Il permet aussi:&lt;br /&gt;
# Venir en complément de l'algorithme principal. Par exemple faire un réglage général avec &amp;quot;main&amp;quot;  ''a minima'', puis dans certaines zones choisies réduire le bruit plus profondément avec Denoise &amp;quot;Local contrast &amp;amp; Denoise&amp;quot;.&lt;br /&gt;
# Comme le traitement &amp;quot;local&amp;quot; est plutôt en milieu de processus (le module Denoise &amp;quot;main&amp;quot; est au début du processus), il va autoriser une réduction du bruit généré par les traitements intermédiaires et ceux de &amp;quot;Local adjustments&amp;quot; en ajoutant un dernier RT-spot alloué à Denoise.&lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
Avec 4 choix : off, Conservative, Agressive, Non local means only&lt;br /&gt;
* Non-local means only : Utilise seulement Débruitage par morceaux (patch), (Non-local means), sans utiliser Wavelets&lt;br /&gt;
* Conservative et Agressive concerne Wavelets&lt;br /&gt;
Sauf dans le cas Non local means only, vous pouvez associer Wavelets (luminance et/ou chrominance) avec Non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (Débruitage par morceaux)====&lt;br /&gt;
Débruitage par morceaux - c'est quoi ? Contrairement aux filtres habituels qui réalisent une moyenne des valeurs du groupe de pixels localisés autour d'un pixel cible afin de réduire le bruit, le filtre Non-local means, réalise une moyenne de la totalité des valeurs des pixels contenus dans l'image, pondérées en fonction de leur similarité avec le pixel cible. Le résultat d'un tel filtrage permet d’amoindrir la perte de détails au sein de l'image, comparé aux filtres réalisant des moyennes localement.&lt;br /&gt;
Il est doté de 5 sliders:&lt;br /&gt;
* Strength : règle d'intensité de l'action (à zéro, pas d'action)&lt;br /&gt;
* Detail recovery : utilise un Laplacien pour cibler l'action sur les aplats, et préserver les structures (détails)&lt;br /&gt;
* Gamma : les valeurs faibles préservent détails et structure, les valeurs élevées accroissent le débruitage.&lt;br /&gt;
* Maximum patch size : adapte le débruitage à la taille des objets à débruiter &lt;br /&gt;
* Maximum radius size : les valeurs élevées accroissent le débruitage, au détriment du temps de traitement.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
Cette fonction permet 6 usages et doit être utilisé en mode 1:1 (zoom 100%):&lt;br /&gt;
# Ne sélectionner qu'une zone limitée à débruiter (par couleur...) et laisser le reste de l'image bruitée&lt;br /&gt;
# Débruiter une zone qui aura vu le bruit s'accroître notamment à cause d'un accroissement important de l'exposition, ou de débouchage des ombres&lt;br /&gt;
# apporter un flou gaussien par niveau (pour les faibles niveaux 0, 1 et 2) pour simuler un bokeh&lt;br /&gt;
&lt;br /&gt;
* Zone minimum d'action pour les ondelettes (wavelet) : 128 pixels * 128 pixels&lt;br /&gt;
* moins de courbes, mais plus de curseurs afin de sélectionner le bon niveau de décomposition &amp;quot;wavelet&amp;quot; et affiner le résultat.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
Pour la luminance vous disposez de:&lt;br /&gt;
* Une courbe qui permet de répartir l'action (force en ordonnée), en fonction du niveau de décomposition en ondelettes (en abscisse : détails fins de 0 à 2, gros détails - aplats- à partir de 3).  &lt;br /&gt;
* Luma detail recovery: utilise la fonction DCT (Discrete Cosinus) transform pour récupérer progressivement les détails. Le curseurs à 0, l'action de la DCT est maximum, si vous souhaitez restituer des détails, accroissez les valeurs.&lt;br /&gt;
* Equalizer white-black : équilibre l'action entre les tons sombres et clairs&lt;br /&gt;
* Gamma : les valeurs faibles préservent détails et structure, les valeurs élevées accroissent le débruitage.&lt;br /&gt;
* Denoise hue equalizer : courbe qui permet d'ajuster le débruitage en fonction de la teinte (Hue)&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* vous pouvez différencier l'action sur la chrominance en fonction de la grosseur du bruit - fine ou coarse:  fine (correspond aux 4 premiers niveaux) et coarse (correspond aux niveaux supérieurs à 4) .&lt;br /&gt;
* de plus vous avez à votre disposition, un curseur DCT : pour la chrominance, réglés par défaut à 0%. DCT est désactivé pour une valeur de 100.&lt;br /&gt;
** l'algorithme utilise aussi pour la chrominance une transformée de Fourier (FFT - fast fourier transformed - DCT discrete Cosinus transformed). Le curseur à 0, l'action de la DCT est maximum, si vous souhaitez restituer des détails, accroissez les valeurs.&lt;br /&gt;
* Qualité améliorée (chroma)&lt;br /&gt;
** Si vous déplacez le curseur &amp;quot;coarse&amp;quot; à 1, pour la chrominance  un algorithme amélioré est utilisé - en réalité il fait 2 passes.&lt;br /&gt;
** A la position &amp;quot;1&amp;quot; l'algorithme améliore seulement l'algorithme fine&lt;br /&gt;
** A partir de &amp;quot;2&amp;quot; l'algorithme coarse est activé.&lt;br /&gt;
* Equalizer Color : Vous disposez d'un equalizer pour la chrominance. Il équilibre la force d'action sur le canal rouge -vert ou sur le canal bleu - jaune.&lt;br /&gt;
&lt;br /&gt;
=====Deux Expanders=====&lt;br /&gt;
======Expander: Denoise based on luminance mask======&lt;br /&gt;
Vous permet d'agir sur le débruitage en fonction des informations de luminance de l'image contenues dans le masque L(L) ou LC(H) (Masque et modifications).&lt;br /&gt;
Le masque L(L) ou le masque LC(H) doit être activé pour utiliser cette fonction.&lt;br /&gt;
&lt;br /&gt;
* Renforce dark/light areas (Rdla) : agit sur le débruitage des zones sombres et claires.&lt;br /&gt;
Les deux sliders ci-dessous agissent en fonction de &amp;quot;Renforce dark/Light areas&amp;quot;:&lt;br /&gt;
* Dark area luma threshold:  si Renforce dark/light areas (Rdla) est supérieur à  1, le débruitage est progressivement augmenté de 0 % pour le réglage du seuil &amp;quot;noir&amp;quot; (par défaut réglé à 12) à 100 % pour la valeur maximale du noir (déterminée par le masque).&lt;br /&gt;
* Light area luma threshold : Le débruitage est progressivement réduit de 100 % pour le réglage du seuil  (par défaut réglé à 85) à 0 % pour la valeur maximale du blanc (déterminée par le masque).&lt;br /&gt;
* Dans la zone située entre les deux seuils, les réglages du débruitage ne sont pas affectés par le masque.&lt;br /&gt;
&lt;br /&gt;
======Expander: Recovery based on luminance mask======&lt;br /&gt;
Permet de cibler le débruitage en fonction de l'information de luminance de l'image contenue dans les masques L(L) ou LC(H) (Masque et modifications).&lt;br /&gt;
Le masque L(L) ou le masque LC(H) doit être activé pour utiliser cette fonction.&lt;br /&gt;
* Si le masque est en dessous du seuil Dark area luma threshold (défaut 12),  Denoise sera appliqué progressivement.&lt;br /&gt;
* si le masque est au-dessus du seuil Light area luma threshold (défaut 85), Denoise sera appliqué progressivement.&lt;br /&gt;
* Entre les deux, les paramètres de l'image sans Denoise seront maintenus, à moins que vous n'ajustiez les curseurs Gray area luminance denoise ou Gray area chrominance denoise.&lt;br /&gt;
&lt;br /&gt;
=====Autres=====&lt;br /&gt;
* Le curseur &amp;quot;Scope&amp;quot; permet de faire varier l'action selon le deltaE du sujet en tenant compte de la transition, par exemple la zone sélectionnée où le deltaE sera pris en compte totalement aura une intensité de dé-bruitage maximum, et à l'inverse le débruitage sera plus faible lorsque le deltaE ne sera pas (ou peu) pris en compte.&lt;br /&gt;
* Un très léger accroissement de la saturation est exécuté, si vous actionnez l'un ou l'autre des curseurs &amp;quot;chroma&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Action combinée avec Blur &amp;amp; Noise====&lt;br /&gt;
Vous pouvez conjuguer l'action dans les cas délicats avec le module précité notamment&lt;br /&gt;
* Gaussian Blur Noise grain&lt;br /&gt;
* Median&lt;br /&gt;
* Guided Filter : qui va agir un peu à la manière d'un filtre bilatéral notamment pour la dimension &amp;quot;chrominance&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Bilateral filter====&lt;br /&gt;
Ce dispositif est la réplique du Impulse denoise des rubriques générales. De mon point de vue son action va au delà du bruit d'impulsion.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Quelques liens avec Log Encoding====&lt;br /&gt;
Exemple d'utilisation :&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments/fr#Log_encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments/fr#Log_Encoding_et_r.C3.A9cup.C3.A9ration_des_hautes_lumi.C3.A8res | Log Encoding et récupération des hautes lumières]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments/fr#Autre_exemple_avec_Log_Encoding | Autres exemples avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Ce module dérivé de celui présent sur ART (Alberto Griggio - merci à lui pour cet excellent module) permet de traiter les images sous exposées, ou à très haute dynamique&lt;br /&gt;
Il encode les données avec une échelle logarithmique qui va assurer une compression intelligente des données.&lt;br /&gt;
&lt;br /&gt;
J'ai utilisé le vocabulaire et la présentation des modules Ciecam, même si beaucoup de fonctionnalités sont absentes.&lt;br /&gt;
Ce module Log Encoding RGB, est complété par des réglages issus de Cam16.&lt;br /&gt;
&lt;br /&gt;
Dans une première étape, il est important de connaître les valeurs des zones noires en écart Ev (Black Ev) et celles des zones blanches (White Ev) pour évaluer le Dynamic range - par défaut à 15 (+ 10 Ev white, -5 Ev black, Mean luminance (Scene conditions) = 10%). Cette estimation est réalisée en amont du processus, avec une copie d'image réalisée juste après la conversion colorimétrique  (passage à sRGB, Prophoto...), donc avant les opérations &amp;quot;rgb&amp;quot; du process principal, en particulier &amp;quot;Local adjustments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Bien sûr Scope fonctionne et permet de cibler l'action sur certaines étendues de couleurs.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure levels====&lt;br /&gt;
* Le système va calculer ces 2 valeurs (blackEv, WhiteEv) si vous cliquez sur le bouton - Automatic.&lt;br /&gt;
* L'algorithme prend en compte la taille du RT-spot et permet de différentier si nécessaire des zones à fort contraste ou sombres par rapport aux autres. Bien sûr si vous choisissez un RT-spot qui couvre toute l'image les résultats seront proches de ceux obtenus avec ART. &lt;br /&gt;
&lt;br /&gt;
Par défaut cette fonctionnalité est désactivée  - case à cocher &amp;quot;BlackEv and WhiteEv for whole image&amp;quot;&lt;br /&gt;
* Bien sûr vous pouvez retoucher directement les valeurs de Black Ev, White Ev, Value, mais le calcul ne sera ré-effectué automatiquement que si vous cliquez sur  le gros bouton &amp;quot;Automatic&amp;quot;.&lt;br /&gt;
* Avec BlackEv and WhiteEv for whole image, désactivée, si vous positionnez le RT-spot sur une zone claire, les valeurs Mean Luminance - (Scène conditions) seront perturbées et probablement trop élevées, donc :&lt;br /&gt;
** privilégiez les zones sombres, &lt;br /&gt;
** ou retouchez si nécessaire &amp;quot;Mean luminance&amp;quot; en le réduisant, &lt;br /&gt;
* ou laissez activée la case à cocher.&lt;br /&gt;
&lt;br /&gt;
=====Whites distribution &amp;amp; Blacks distribution =====&lt;br /&gt;
Ces deux curseurs permettent - toujours sur une copie de l'image, et donc non directement - d'agir sur la distribution de la dynamique de l'image. Les zones proches de 'White Ev' et de 'Black Ev' voient leurs distribution changer, respectivement par 'Whites distribution' et 'Black distribution'.&lt;br /&gt;
* les valeurs négatives de 'White distribution' vont agir sur les hautes lumières, rendant celles-ci plus perceptibles.&lt;br /&gt;
* les valeurs positives de 'Black distribution', vont agir selon les images, généralement vers un éclaircissement des zones sombres.&lt;br /&gt;
&lt;br /&gt;
Ces deux réglages ont aussi une incidence sur :&lt;br /&gt;
* les valeurs de 'White Ev' et 'Black Ev',&lt;br /&gt;
* la dR (Dynamic Range),&lt;br /&gt;
* le point gris.&lt;br /&gt;
&lt;br /&gt;
=====Brightness compression=====&lt;br /&gt;
'Brightness compression' vous permet d'agir sur les lumières et hautes lumières de l'image en assurant une compression progressive des données.&lt;br /&gt;
Ce concept, inspiré de ART, a été modifié pour le rendre plus progressif : les valeurs supérieures à 0.6 se traduisent par une compression maximale.&lt;br /&gt;
&lt;br /&gt;
====Scene conditions====&lt;br /&gt;
Si vous souhaitez que le calcul prenne en compte automatiquement le Point gris de l'image avant le process, il faut laisser la case à cocher Auto mean luminance (yb%) activée. Selon le cas, 2 algorithmes assurent un calcul automatique, celui initialement prévu par les calculs originaux, il peut dans certains cas échouer. Alternativement un calcul fait à partir de Yb (luminance moyenne) s'y substitue.&lt;br /&gt;
3 réglages sont à votre disposition&lt;br /&gt;
* Mean Luminance (Yb%) :Yb est la luminance relative du background, exprimée en % de gris. 18% de gris correspond à une luminance de fond de 50% exprimée en CIE L. Les données sont basées sur la luminance moyenne de l'image&lt;br /&gt;
* Absolute luminance : Correspond à la luminance en candelas par m2 au moment de la prise de vue, calculée automatiquement à partir des données exif.&lt;br /&gt;
* Surround : Modifie les tons et les couleurs pour prendre en compte les conditions de la scène.&lt;br /&gt;
** Moyenne (Average) : Environnement lumineux moyen (standard).&lt;br /&gt;
** Légèrement Sombre (Dim) : Environnement sombre. L'image devient légèrement lumineuse.&lt;br /&gt;
** Très Sombre (Dark). L'image devient plus lumineuse&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast : agit principalement sur les hautes fréquences (Basic)&lt;br /&gt;
* Contrast J : contraste utilisant la luminance relative (Standard)&lt;br /&gt;
* Contrat threshold (J &amp;amp; Q) : ajuste les tons moyens des 2 contrastes J &amp;amp; Q (Standard)&lt;br /&gt;
* Saturation : agit essentiellement sur les tons moyens et les lumières (Standard)&lt;br /&gt;
&lt;br /&gt;
In all tools (advanced)&lt;br /&gt;
* Lightness J = Luminosité - luminance relative&lt;br /&gt;
* Brightnees Q : Clarté - Luminance absolue&lt;br /&gt;
* Contrast Q : contraste utilisant la luminance abslolue&lt;br /&gt;
* Chroma : coloration d’un stimulus relativement à la clarté d’un stimulus qui apparaît blanc sous des conditions identiques.&lt;br /&gt;
* Colorfullnes : La quantité perçue de teinte par rapport au gris.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%) : luminance relative du background, exprimée en % de gris. 18% de gris correspond à une luminance de fond de 50% exprimée en CIE L. Les données sont basées sur la luminance moyenne de l'image (en sortie souhaitée)&lt;br /&gt;
* Absolute luminance: luminance absolue de l'environnement de sortie (par défaut 16cd/m2)&lt;br /&gt;
* Chromatic adaptation : L'adaptation chromatique permet d'interpréter une couleur en fonction de son environnement spatio-temporel. Utilisable lorsque la balance des blancs s'écarte de manière significative de la référence D50. Adapte les couleurs à l'éclairage du périphérique de sortie.&lt;br /&gt;
* Surround : Modifie les tons et les couleurs pour prendre en compte les conditions de l'environnement de sortie.&lt;br /&gt;
** Moyenne (Average) : Environnement lumineux moyen (standard).&lt;br /&gt;
** Légèrement Sombre (Dim) : Environnement sombre. L'image devient légèrement sombre.&lt;br /&gt;
** Très Sombre (Dark). L'image devient plus sombre&lt;br /&gt;
** Extrêmement sombre (Extremely Dark) : L'image devient très sombre&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
A la fin du traitement &amp;quot;log&amp;quot;, vous pouvez agir sur la luminance résultante avec un Graduated Filter doté de 2 sliders : gradient strength et gradient angle.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Exemple d'utilisation de Color Appearance et des fonctionnalités HDR :[[Local_Adjustments/fr#HDR-SDR_Premi.C3.A8re_approche_:_Log_encoding_.E2.80.93_Cam16_.E2.80.93_JzCzHz_.E2.80.93_Sigmoid |HDR-SDR Première approche : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
Le module Color appearance(Cam16 &amp;amp; JzCzHz) est à la fois:&lt;br /&gt;
* plus simple que Color Appearance &amp;amp; Lighting(Ciecam02/16)&lt;br /&gt;
** il ne dispose pas de CAM02, uniquement Cam16&lt;br /&gt;
** pas de mode Automatic symmetric, ou Mixed. Donc pas de possibilité d'adaptation chromatique à la fin d'un processus.&lt;br /&gt;
** pas de choix du White-point model et pas de choix de l'illuminant.&lt;br /&gt;
** pas de possibilités de réglages séparés de CATO2/16 adaptation (Scene et Viewing conditions).&lt;br /&gt;
** pas de réglages de température et teinte dans Viewing conditions.&lt;br /&gt;
&lt;br /&gt;
* plus complet que Color Appearance &amp;amp; Lighting(Ciecam02/16) et selon le niveau de complexité (Basic, Standard, Advanced)&lt;br /&gt;
** prise en compte de HDR PQ (Peak Luminance) : première approche HDR&lt;br /&gt;
** fonction Sigmoid Q &amp;amp; Log encoding Q, tenant compte de Black Ev et White Ev&lt;br /&gt;
** masques&lt;br /&gt;
** et en mode advanced, le module expérimental JzCzHz (pour un meilleur traitement HDR) .&lt;br /&gt;
&lt;br /&gt;
Globalement le module Color Appearance(Cam16 et JzCzHz), au moins pour la partie Cam16, est plus simple, plus intuitif, et prend en compte les possibilités de Local Adjustments : deltaE, Scope, transition, excluding spot, etc.&lt;br /&gt;
&lt;br /&gt;
Pour une présentation de Cam16 : [[Local_Adjustments/fr#Utilisation_de_Cam16_et_des_fonctionnalit.C3.A9s_HDR |Utilisation de Cam16 et des fonctionnalités HDR]]&lt;br /&gt;
&lt;br /&gt;
Pour une présentation de JzCzHz :[[Local_Adjustments/fr#Le_module_exp.C3.A9rimental_JzCzHz |Le module expérimental JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
Pour voir le tutoriel: [[CIECAM02/fr#Tutoriel_Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29 |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
&lt;br /&gt;
A titre d'information JzCzHz contient divers outils afin de montrer qu'il peut se substituer à Lab.&lt;br /&gt;
* Courbes: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz)&lt;br /&gt;
* Shadows/Highlights Jz&lt;br /&gt;
* Wavelet Jz : &lt;br /&gt;
** Local contrast&lt;br /&gt;
** Clarity &amp;amp; Sharp Mask&lt;br /&gt;
&lt;br /&gt;
==Cas d'usage spécifique : réduction des défauts (capteur sale, yeux rouges, ...)==&lt;br /&gt;
Exemple d'utilisation:[[Local Lab controls/fr#Traiter les yeux rouges - retirer les défauts du capteur | Dans Premiers pas - Traiter les yeux rouges - retirer les défauts du capteur]]&lt;br /&gt;
&lt;br /&gt;
===Généralités===&lt;br /&gt;
Par conception &amp;quot;Local Adjustements&amp;quot; n'a pas été conçu pour éliminer ces défauts. Néanmoins par effet de bord, certains défauts apparents et gênant en photographie peuvent être réduits voire supprimés. Ceci bien sûr n'est pas incompatible avec d'autres modules plus spécialisés incorporés ou non à &amp;quot;Local adjustements&amp;quot;...&lt;br /&gt;
Au moins 3 fonctions présentes, en adaptant l'usage, peuvent être utilisées, séparément ou ensemble :&lt;br /&gt;
* &amp;quot;Color &amp;amp; light&amp;quot; pour des défauts ponctuels ou les yeux rouges;&lt;br /&gt;
* &amp;quot;Contrast by detail level&amp;quot; pour des défauts répartis (taches de graisse,..) ;&lt;br /&gt;
* &amp;quot;Wavelet&amp;quot; (Local contrast &amp;amp; wavelets) pour les défauts répartis (taches de graisse);&lt;br /&gt;
* &amp;quot;Blur/Grain&amp;quot; en complément éventuel : attention cette action est assez destructrice - à utiliser avec modération.&lt;br /&gt;
&lt;br /&gt;
Vous pouvez agir soit:&lt;br /&gt;
* directement, cas général, sur le fichier &amp;quot;raw&amp;quot;, ou &amp;quot;TIF&amp;quot;, etc.&lt;br /&gt;
* soit sur le fichier flat-field si vous en avez élaboré un.&lt;br /&gt;
===Choix de la taille du RT-spot===&lt;br /&gt;
On peut être tenté d'ajuster la taille du RT-spot à celles des défauts, en général petits. Cette démarche est en général à éviter car :&lt;br /&gt;
* elle masque la visibilité de l'action&lt;br /&gt;
* elle risque dans certains cas soit un crash dus à des problèmes d'allocation mémoire, soit des dysfonctionnements aux limites des processus&lt;br /&gt;
&lt;br /&gt;
Il est préférable de mettre un RT-spot couvrant largement le défaut, et soit facilement visible par exemple un RT-spot de 50x50 pixels ou 100x100 pixels, puis:&lt;br /&gt;
* choisir une taille du Spot (Spot size) petite, adaptée au défaut&lt;br /&gt;
* réduire la transition à une valeur faible entre 2 et 10, de telle façon que à cette valeur la quasi totalité du défaut est couvert&lt;br /&gt;
* accroître &amp;quot;transition decay&amp;quot; jusque 10 ou 15, avec ce réglage la décroissance d'action est très rapide&lt;br /&gt;
* agir sur &amp;quot;scope&amp;quot; pour centrer l'action sur le défaut&lt;br /&gt;
Par exemple si c'est un oeil rouge de 6x6 pixels, choisissez &amp;quot;transition = 5&amp;quot;, &amp;quot;transition decay = 10&amp;quot;, à partir du 8ème pixel l’affaiblissement (sans l'action de &amp;quot;scope&amp;quot;) est de plus de 90%.&lt;br /&gt;
&lt;br /&gt;
Exemple d'affaiblissement - sans action avec &amp;quot;scope&amp;quot;:&lt;br /&gt;
* taille du RT-spot 100x100&lt;br /&gt;
* taille du défaut 10x10 (Iris d'un oeil)&lt;br /&gt;
* &amp;quot;transition&amp;quot; = 9&lt;br /&gt;
* &amp;quot;transition decay&amp;quot; = 15 &lt;br /&gt;
* à la limite du défaut 10x10 baisse de l'action : 75%&lt;br /&gt;
* à 2 pixels après le défaut, baisse de l'action 28%&lt;br /&gt;
* à 4 pixels après le défaut baisse de l'action 12%&lt;br /&gt;
&lt;br /&gt;
Si le RT-spot, pour le même défaut est de 50x50&lt;br /&gt;
* à 2 pixels après le défaut, baisse de l'action 14%&lt;br /&gt;
* à 4 pixels après le défaut, baisse de l'action 4%&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
===Utilisation avec le module &amp;quot;Color &amp;amp; Light&amp;quot;===&lt;br /&gt;
* Activez &amp;quot;Color  Light&amp;quot;&lt;br /&gt;
*Vous pouvez utiliser l'équivalent d'une fonction &amp;quot;yeux rouges&amp;quot; en choisissant un encadrement assez serré de l’œil - sélecteur circulaire centré sur le rouge, délimiteurs de spot proches de l’œil - une valeur de scope réduite, puis agir sur réduction &amp;quot;lightness&amp;quot; -100, et réduction chrominance -100.&lt;br /&gt;
*De la même manière vous pouvez réduire les défaut du capteur de type &amp;quot;Spot IR&amp;quot;,  en choisissant un encadrement assez serré du défaut - sélecteur circulaire centré sur le défaut, délimiteurs de spot proches du défaut - puis agir sur &amp;quot;chrominance&amp;quot; en réduisant la valeur, agir éventuellement sur &amp;quot;scope&amp;quot; pour réduire l'étendue de l'action.&lt;br /&gt;
*Vous pouvez dans des cas simples, réduire les défauts de type &amp;quot;capteur encrassé&amp;quot; notamment lorsque celui-ci est gras. Ceci se traduit par des taches qui apparaissent sur les fonds unis. Pour cela choisissez un encadrement assez serré du défaut - sélecteur circulaire centré sur le défaut (adaptez la taille du spot) , délimiteurs de spot pas trop proches du défaut pour permettre une transition peu visible. Puis: a) réduisez &amp;quot;Transition&amp;quot; à des valeurs faibles - transition decay élevé; b) agissez sur &amp;quot;luminance&amp;quot; et éventuellement sur &amp;quot;chrominance&amp;quot; pour approcher le rendu de la zone polluée à celui de la zone saine; c) agir modérément sur &amp;quot;scope&amp;quot; pour moduler l'action souhaitée. d) possibilité d'utiliser &amp;quot;Color correction grid - direct&amp;quot;, ainsi que &amp;quot;Softradius&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Utilisation avec le module &amp;quot;Contrast by detail levels&amp;quot;===&lt;br /&gt;
Dans le cas de capteur encrassé (de type &amp;quot;graisse&amp;quot;), et lorsque la zone est importante ou pour une série de petits défauts, Il peut être utile d'utiliser &amp;quot;Contrast by details levels&amp;quot; qui va agir comme un outil &amp;quot;wavelet&amp;quot; sur la luminance et aussi si nécessaire sur la chrominance. Dans ce cas: &lt;br /&gt;
# mettez le Spot de sélection sur un défaut prononcé (en adaptant sa taille si nécessaire); &lt;br /&gt;
# choisissez une zone de sélection large pour couvrir la majorité de la surface concernée par les défauts; &lt;br /&gt;
# Sélectionnez une valeur de transition assez importante (selon le cas) et &amp;quot;transition decay&amp;quot; élevé; &lt;br /&gt;
# Activez &amp;quot;Contrast by detail levels&amp;quot; et agissez sur les niveaux 3 , 4 (rarement 5) ou plus faibles en réduisant le contraste (valeurs inférieures à 100) et en agissant si nécessaire sur le curseur chroma.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attention, la zone d'action est limitée à 64x64 pixels, en dessous de ces valeurs, CBDL est désactivé pour éviter le crash - la décomposition en ondelettes de Harr, nécessite au mimima 64x64 pixels.&lt;br /&gt;
&lt;br /&gt;
===Utilisation avec le module &amp;quot;Local Contrast &amp;amp; Wavelet&amp;quot;===&lt;br /&gt;
Vous pouvez utiliser notamment :&lt;br /&gt;
* contrast by levels : en agissant sur la courbe, en étant proche de la partie gauche de la courbe - les niveaux faibles - et en réduisant le micro-contraste&lt;br /&gt;
* vous pouvez agir si nécessaire sur &amp;quot;Chroma levels&amp;quot; pour réduire les artefacts colorés&lt;br /&gt;
* Blur levels : là encore avec les niveaux faibles, vous pouvez flouter (blur) les petits défauts, avec ou sans action de &amp;quot;contrast by levels&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Annexe==&lt;br /&gt;
=== Quel type de contrôle local? ===&lt;br /&gt;
Lorsqu'on observe les différents logiciels du marché on trouve plusieurs types de contrôles locaux&lt;br /&gt;
# les contrôles de type &amp;quot;lasso&amp;quot;, associés à des calques et masques de fusion, comme par exemple dans Photoshop (c). Ce type de contrôle est majoritaire dans les logiciels (Photoshop (c), Gimp (c), Darktable (c)...) et l'avis des utilisateurs est obligatoirement orienté vers ceux-ci au détriment du point 4. ci-dessous moins connu!&lt;br /&gt;
# les dispositifs de suppression de &amp;quot;yeux rouges&amp;quot;, ou de &amp;quot;spot&amp;quot; (poussières...) liés aux imperfections du capteur&lt;br /&gt;
# les brosses qui permettent des mini corrections locales&lt;br /&gt;
# les contrôles de type U-points, utilisés jusque récemment dans Nikon Capture NX2 (c), ou comme complément à d'autres logiciels comme Nik Software (c), et récemment dans DxO ou Capture NXD. Pour qui a tâté de ces dispositifs (encore minoritaires aujourd'hui) il n'est pas question de revenir aux calques et masques de fusion! Ce type de contrôle '''nécessite un apprentissage différent de ceux de type lasso-calque et un désapprentissage cognitif''' de ceux-ci. De mon point de vue, ils sont globalement plus performants.&lt;br /&gt;
&lt;br /&gt;
Dans la version présente de Rawtherapee, l’algorithme développé est proche dans le principe du point 4. ci-dessus, les U-points avec quelques possibilités pour 2. Bien sûr, le code de Nik Software m'est inconnu, mais il y a quelques années j'ai été séduit par la facilité d'utilisation et les performances des U-points, et j'ai entrepris de développer un produit qui ne ferait pas appel, ni au lasso, ni aux calques, ni aux masques de fusion (même si j'en ai récemment ajouté en complément).&lt;br /&gt;
&lt;br /&gt;
Bien sûr rien n'interdit d'avoir les 3 possibilités (Lasso-calque, retouches spot, U-points) !&lt;br /&gt;
&lt;br /&gt;
=====Évolution possible?=====&lt;br /&gt;
A terme, il doit être possible, même si l'utilité me semble discutable du fait de l'algorithme de détection de forme - à noter que DxO et Capture NXD n'ont qu'une sélection circulaire - , de remplacer l'ellipse ou le rectangle, par une courbe  (courbe de Beziers) ou un polygone tracée à l'aide de la souris, à condition :&lt;br /&gt;
* que la transformée homothétique - de centre le centre du Spot &amp;quot;C&amp;quot; - de chacune des 4 courbes n'ait pas d'intersection avec la courbe originale.&lt;br /&gt;
* chacune des 4 courbes passe par 2 &amp;quot;points délimiteurs&amp;quot; &amp;quot;T&amp;quot; ou &amp;quot;B&amp;quot; et &amp;quot;L&amp;quot; ou &amp;quot;R&amp;quot;&lt;br /&gt;
* chacune des 4 courbes soit à l'intérieur des 4 rectangles &amp;quot;C&amp;quot;, &amp;quot;T&amp;quot;, &amp;quot;L&amp;quot;, &amp;quot;C&amp;quot; ou &amp;quot;C&amp;quot;, &amp;quot;T&amp;quot;, &amp;quot;R&amp;quot;, &amp;quot;C&amp;quot; ou &amp;quot;C&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;L&amp;quot;, &amp;quot;C&amp;quot; ou &amp;quot;C&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;R&amp;quot;, C&amp;quot; ou à l'intérieur de la zone globale en permettant l'homothétie comme évoqué ci-dessus&lt;br /&gt;
* permettre l'élaboration de 4 LUT de type y=f(x)&lt;br /&gt;
&lt;br /&gt;
Cette &amp;quot;amélioration&amp;quot; intellectuellement satisfaisante, ne devrait être que d'un apport négligeable (sauf cas spécifiques) - dans le cas des RT-spots. Néanmoins il sera toujours possible de faire coexister les actuels RT-spot avec des contrôles par&amp;quot;lasso&amp;quot; de type Photoshop (c).&lt;br /&gt;
&lt;br /&gt;
=== Quels défis à résoudre? ===&lt;br /&gt;
Plusieurs problèmes généraux sont à résoudre afin d'obtenir un fonctionnement fluide :&lt;br /&gt;
* permettre un nombre quasi illimité de RT-spot (spot de contrôles);&lt;br /&gt;
* adapter les algorithmes locaux aux problèmes d'échelle, car beaucoup d'algorithmes tiennent compte de la taille de l'image - donc de la zone traitée. Cet aspect est fondamental, notamment avec les courbes qui agissent sur toute l'image;&lt;br /&gt;
* adapter - lorsque c'est le cas - les algorithmes RGB du code principal, en mode L*a*b* utilisé  par le contrôle local&lt;br /&gt;
* minimiser l'occupation mémoire et les temps de traitement en sortie JPG et TIF;&lt;br /&gt;
* permettre des mises à jour logicielles faciles en cas d’évolution des algorithmes ou d'évolution du nombre de méthodes ;&lt;br /&gt;
* optimiser les écarts entre &amp;quot;preview&amp;quot; et sortie JPG / TIF; &lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
Pour chaque RT-spot :&lt;br /&gt;
* permettre selon le cas, une action dans la zone sélectionnée ou à l'extérieur de la zone sélectionnée;&lt;br /&gt;
* permettre selon le cas une détection de forme pour délimiter l'action ou une action également répartie sur toute la zone sélectionnée;&lt;br /&gt;
* assurer une transition entre le cœur de la zone traitée et le reste de l'image;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
Actuellement, les RT-spot (spot de contrôles) sont opérationnels, pour le mode L*a*b*, et pour les méthodes suivantes:&lt;br /&gt;
# Color &amp;amp; light :en mode basic avec possibilité de masques (mode standard et et advanced), et inverse ;&lt;br /&gt;
# Dynamic Range &amp;amp; Exposure: en mode basic avec possibilité de masques (mode standard et et advanced) et inverse;&lt;br /&gt;
# Shadows Highlight &amp;amp; Tone equalizer: en mode basic avec possibilité de masques (mode standard et et advanced) et inverse;&lt;br /&gt;
# Local Contrast &amp;amp; Wavelets :en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Vibrance &amp;amp; Warm/Cool : en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Soft Light &amp;amp; Original Retinex; Soft Light en mode basic, Original Retinex en mode standard et advanced)&lt;br /&gt;
# Blur/grain &amp;amp; Denoise: en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Dehaze - Retinex : Dehaze en mode basic et standard, et Retinex en mode advanced avec masques (spéciaux)&lt;br /&gt;
# Sharpening : en mode normal et inverse;&lt;br /&gt;
# Tone Mapping: en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Contrast By Detail Levels : en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Log Encoding : en mode basic avec possibilité de masques (mode standard et et advanced);&lt;br /&gt;
# Color Appearance(Cam 16 &amp;amp; JzczHz) :Cam16 en mode basic avec possibilité de masques (mode standard et et advanced), JzCzHz en mode advanced.&lt;br /&gt;
&lt;br /&gt;
===Développement - Performance - Interface graphique - GUI===&lt;br /&gt;
L'ensemble de l'équipe de Rawtherapee a contribué au développement, mais en particulier:&lt;br /&gt;
# Principe des algorithmes - code de base - Jacques Desmis&lt;br /&gt;
# Amélioration des performances (vitesse, mémoire...) - Ingo Weyrich&lt;br /&gt;
# Interface GUI - Pierre Cabrera. Elle me semble simple et intuitive. &lt;br /&gt;
# Aide à la mise au point (essais, conseils, échanges...) : Sébastien Guyader (jusqu'en 2019). A partir de 2020,  Wayne Sutton, Jacques Dekker, Andy Astbury.&lt;br /&gt;
# Mise en bon anglais du GUI (outils, sliders, courbes, Tooltips..) et mise en anglais de la documentation : Wayne Sutton. &lt;br /&gt;
&lt;br /&gt;
Certaines parties du code, je les ai souvent adaptées, sont issues du travail de Alberto Griggio: &lt;br /&gt;
* Detail threshold recovery (denoise), &lt;br /&gt;
* Film grain,&lt;br /&gt;
* Tone Equalizer,&lt;br /&gt;
* Amélioration de Guide Filter Luminance (log), &lt;br /&gt;
* Log Encoding.&lt;br /&gt;
&lt;br /&gt;
====Nouveauté du GUI (Pierre Cabrera)====&lt;br /&gt;
Depuis avril 2020, l'interface graphique présente de nombreuses innovations et depuis mai 2020, vous pouvez pour chaque outil, choisir le niveau de complexité &amp;quot;Advanced&amp;quot; ou &amp;quot;Standard&amp;quot; ou &amp;quot;Basic&amp;quot;:&lt;br /&gt;
* pour chaque RT-spot vous pouvez choisir les outils qui vous conviennent. Ce qui va éviter de noyer l'interface avec des champs inutiles. Par exemple vous pouvez choisir &amp;quot;Color &amp;amp; Light&amp;quot; avec le niveau de complexité &amp;quot;Basic&amp;quot; et &amp;quot;Blur/grain &amp;amp; Denoise&amp;quot; avec le niveau de complexité &amp;quot;advanced&amp;quot;.&lt;br /&gt;
* les fichiers pp3 ne contiennent que les modifications, ce qui simplifie et accélère le travail courant.&lt;br /&gt;
* lorsque vous réalisez un &amp;quot;copy&amp;quot; &amp;quot;paste&amp;quot;  des profiles - soit à partir du &amp;quot;File Browser&amp;quot;, soit à partir de la barre des &amp;quot;Processing profiles&amp;quot;, un menu vous propose quels RT-spot vous voulez copier.&lt;br /&gt;
&lt;br /&gt;
===Aide - Tooltip===&lt;br /&gt;
Vous pouvez désactiver l'aide qui apparaît pour certains sliders, expanders, comboBox,... et qui peut être gênante.&lt;br /&gt;
&lt;br /&gt;
Aller dans &amp;quot;Preferences &amp;quot; - &amp;quot;General&amp;quot; - &amp;quot;Show local adjustments Tooltip&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Temps de traitement et utilisation de la mémoire ===&lt;br /&gt;
&lt;br /&gt;
Lorsqu'on utilise la sortie JPG ou TIF, et pour le mode &amp;quot;normal&amp;quot;, l'algorithme n'effectue les calculs que pour la zone délimitée. En ce sens les temps de traitement et l'occupation mémoire sont réduits.&lt;br /&gt;
Bien sûr le temps de traitement va dépendre du nombre de spots de contrôles, de leur taille, et du type de traitement.&lt;br /&gt;
&lt;br /&gt;
Les plus gros consommateurs de temps sont &lt;br /&gt;
* &amp;quot;Retinex&amp;quot; (Dehaze &amp;amp; Retinex) : forte influence de la taille du spot, de &amp;quot;radius&amp;quot; et de &amp;quot;scale&amp;quot; et de &amp;quot;chroma&amp;quot; au delà de 40, ainsi que de FFTW.&lt;br /&gt;
* &amp;quot;Tone Mapping&amp;quot; : &amp;quot;edge stopping&amp;quot; accroît linéairement le temps de traitement. &amp;quot;Reweigthting iterate&amp;quot; multiplie par sa valeur les temps de traitement. On peut très facilement attiendre des temps de plusieurs dizaines de secondes.&lt;br /&gt;
* Denoise (Local contrast &amp;amp; Denoise) : en mode full image, et avec des niveaux de décomposition élevés, des valeurs de mémoire supérieures à 8M° voire 16M° sont nécessaires&lt;br /&gt;
&lt;br /&gt;
Activer FFTW, peut se traduire (grandes images) par des temps de traitement importants.&lt;br /&gt;
&lt;br /&gt;
===DeltaE  ΔE utilisé===&lt;br /&gt;
J'ai choisi la version la plus simple du deltaE.&lt;br /&gt;
&lt;br /&gt;
Si on évalue les valeurs L*a*b* dans l'intervalle : L [0..100] a [-128..+128] b [-128..+128]&lt;br /&gt;
*Si Lc, ac, bc sont les valeurs du pixel courant&lt;br /&gt;
* Si Lr, ar, br sont les valeurs de la référence (converties des valeurs LCH de base)&lt;br /&gt;
&lt;br /&gt;
* deltaE = sqrt(SQR(Lc - Lr) + SQR(ac - ar) + SQR (bc - br))&lt;br /&gt;
* Bien sûr cette équation de base est modifiée si vous utilisez :&lt;br /&gt;
** ab-L balance deltaE;&lt;br /&gt;
** C-H balance deltaE;&lt;br /&gt;
** DeltaE - decay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correspondance avec la valeur de &amp;quot;scope&amp;quot;:&lt;br /&gt;
* il y a une relation entre scope et deltaE et l'affaiblissement (decay), et &amp;quot;threshold deltaE-scope&amp;quot;&lt;br /&gt;
* deltaE-scope threshold agit sur l'étendue de prise en compte&lt;br /&gt;
** par défaut  deltaE-scope threshold = 2 conduit à des valeurs de deltaE prises en compte de 2 à 155&lt;br /&gt;
** si vous réduisez  deltaE-scope threshold, la valeur maximale va être réduite jusque 130, à l'inverse si vous augmentez au maximum, le maximum deltaE sera de 230. De mon point de vue il faut réserver cette situation aux images avec de très grosses variations de gamut, par exemple des fleurs aux couleurs éclatantes. Par contre accroître légèrement deltaE-scope threshold (3 à 5) permet un rendu différent du système.&lt;br /&gt;
*** un deltaE de 230 ne peut se rencontrer que dans des cas extrêmes, par exemple 80 d'écart sur L, 158 sur a, 145 sur b... (uniquement accessible pour les très grands espaces de travail, avec des couleurs de base telles fleurs éclatantes ou couleurs artificielles, et action importante sur les sliders chroma et luma) &lt;br /&gt;
&lt;br /&gt;
Cas avec deltaE-scope threshold = 2 (défaut)&lt;br /&gt;
* les deltaE pris en compte varient de 2 (scope=0) à 155 (scope=100). Bien sûr ce choix est arbitraire on peut changer les 2 seuils mini et maxi (voir ci-dessus), mais il semble fonctionner dans une majorité de cas.&lt;br /&gt;
* 2 n'est pas perceptible par l'œil (mais ici ce n'est pas l'objectif recherché)&lt;br /&gt;
* 155 correspond à des valeurs très élevées, par exemple 80 d'écart sur &amp;quot;a&amp;quot; (composante rouge vert), 80 sur &amp;quot;b&amp;quot; (composante bleu jaune&amp;quot;), 80 sur &amp;quot;L&amp;quot; ou autre exemple 50 sur &amp;quot;L&amp;quot;, 105 sur &amp;quot;a&amp;quot; et 100 sur &amp;quot;b&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Par exemple lorsque &amp;quot;scope&amp;quot; est réglé sur 15, ceci signifie que toutes les couleurs telles que deltaE &amp;lt; 3 seront traitées telles quelles sans atténuation. Celles avec deltaE &amp;gt; 27.5 seront ignorées, les valeurs intermédiaires sont affaiblies d'autant plus qu'on se rapproche de deltaE = 27.5, par exemple:&lt;br /&gt;
* un deltaE de 3 correspond par exemple à (il y a d'autres combinaisons...):&lt;br /&gt;
** delta L = 2&lt;br /&gt;
** delta a = 1&lt;br /&gt;
** delta b = 2&lt;br /&gt;
&lt;br /&gt;
* un deltaE de 15 correspond par exemple à (il y a d'autres combinaisons...) :&lt;br /&gt;
** delta L = 10&lt;br /&gt;
** delta a = 9&lt;br /&gt;
** delta b = 6.6&lt;br /&gt;
&lt;br /&gt;
* ou encore un deltaE de 27.5 par exemple à (il y a d'autres combinaisons...) :&lt;br /&gt;
** delta L = 15&lt;br /&gt;
** delta a = 14&lt;br /&gt;
** delta b = 18.3&lt;br /&gt;
&lt;br /&gt;
Lorsque on augmente &amp;quot;scope&amp;quot;, par exemple à 50, toutes les couleurs telles que deltaE &amp;lt; 4.5 seront traitées telles quelles sans atténuation. Celles avec deltaE &amp;gt; 80 seront ignorées, les valeurs intermédiaires sont affaiblies d'autant plus qu'on se rapproche de deltaE = 80, par exemple:&lt;br /&gt;
* un deltaE de 80 correspond par exemple à (il y a d'autres combinaisons...):&lt;br /&gt;
** delta L = 20&lt;br /&gt;
** delta a = 62&lt;br /&gt;
** delta b = 44,7&lt;br /&gt;
&lt;br /&gt;
Etc.&lt;br /&gt;
&lt;br /&gt;
===Modules et fonctions disponibles par niveau : Basic, Standard, Advanced (expert)===&lt;br /&gt;
* ne sont mentionnées que les différences &amp;quot;Advanced&amp;quot; / &amp;quot;Standard&amp;quot;&lt;br /&gt;
* &amp;quot;Basic&amp;quot; est similaire à &amp;quot;Standard&amp;quot; sans les masques, les courbes, les graduated filters, et évidemment Recovery based on luminance mask, ....&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Slider Spot structure&lt;br /&gt;
* Slider Blur Shape detection&lt;br /&gt;
* Merge files (as in Photoshop, with blend modes (difference, multiply, etc.)&lt;br /&gt;
* Graduated filter: chroma gradient strength, et hue gradient strength&lt;br /&gt;
* Curves: C(L), L(C), L(H), C(H), H(H), RGB Tone curves&lt;br /&gt;
&lt;br /&gt;
* Mask and modifications : Structure Mask, Blur Mask, Laplacian threshold, Gamma, Slope, Shadows, Hue curve, Wavelts levels selection.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Dynamic Range Compression: Gamma, Spot structure&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and modifications : Laplacian threshold, Gamma, Slope, Graduated filter&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
====Shadows Highlight &amp;amp; Tone Equalizer====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and modifications : Laplacian threshold, Gamma, Slope&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm Cool====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* plus d'options dans Vibrance : Pastels tones - Saturated - Curve - Skin tones - Avoid color shift&lt;br /&gt;
* Recovery based on luminance threshold : Decay strength&lt;br /&gt;
* Graduated Filter  Chroma gradient strength, Hue gradient strength&lt;br /&gt;
* Mask and Modifications : Laplacian threshold, Gamma, Slope&lt;br /&gt;
&lt;br /&gt;
====Color Appearance(Cam16 &amp;amp; JzCzHz)====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Change tool position : default, Tone mapping, Wavelet, Dynamic Range&lt;br /&gt;
* Cam 16 Image adjustments : Brightness (Q),  Contrast(Q), Chroma(C), Colorfullness(M), Hue, Curves (lightness, Brightness), Curves (Chroma, Saturation, Colorfullness)&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and modifications : Laplacian threshold, Gamma, Slope&lt;br /&gt;
* module JzCzHz&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Original Retinex (atténuateur de contraste  cf Dodge and Burn): Show Fourier(f) process : Show modified image, delta Laplacien (first), Fourier(f) DCT, Poisson (pde f), No luminance normalization, show modified areas&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain - Denoise====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Blur/Grain (Gaussian Blur - Noise - Grain) : &lt;br /&gt;
** case à cocher f-always Use Fast Fourrier Tansform&lt;br /&gt;
** Recovery based on luminance mask : Inverse algoritm&lt;br /&gt;
* Denoise : &lt;br /&gt;
** Denoise based on luminance mask, &lt;br /&gt;
** Non-local Means luminance : Maximum radius size&lt;br /&gt;
** Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and Modifications (Blur/grain &amp;amp; Denoise): Highlight, Wavelet level selection&lt;br /&gt;
&lt;br /&gt;
====Tone mapping====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Gamma, saturation, Reweighting iterates&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and modifications : Laplacian threshold, Gamma, Slope&lt;br /&gt;
&lt;br /&gt;
====Dehaze - Retinex====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Retinex: with all Retinex tools, Recovery based on luminance mask,  Mask and modifications&lt;br /&gt;
&lt;br /&gt;
Attention dans ce module, pas de différences entre les modes &amp;quot;basic&amp;quot; et &amp;quot;standard&amp;quot; (problème de GUI difficile à résoudre)&lt;br /&gt;
&lt;br /&gt;
====Sharpening====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Contrast threshold, Blur radius, Gmma, Amount, Damping, Iterations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Local contrast &amp;amp; Wavelets====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Wavelets :&lt;br /&gt;
** wavelets levels&lt;br /&gt;
** Residual image (Main): Merge only with original image, Gamma (wavelet pyramids)&lt;br /&gt;
** tous les outils &amp;quot;pyramids&amp;quot; (graduated filter, Edge sharpness, Blur, Contrast by detail level, Tone mapping, Directional contrast&lt;br /&gt;
&lt;br /&gt;
* Local contrast &amp;amp; wavelets:&lt;br /&gt;
** Recovery based on luminance mask : Decay strength&lt;br /&gt;
&lt;br /&gt;
====Contrast by details levels====&lt;br /&gt;
Différences Advanced / Standard&lt;br /&gt;
* Recovery based on luminance mask : Decay strength&lt;br /&gt;
* Mask and modifications : Laplacian threshold&lt;br /&gt;
&lt;br /&gt;
====Log Encoding==== &lt;br /&gt;
Différences Advanced / Standard &lt;br /&gt;
* All tools : lightness(J), Brightness(Q), Contrast(Q), Chroma(C), Colorfulness(M) &lt;br /&gt;
Recovery based on luminance mask : Decay strength&lt;br /&gt;
&lt;br /&gt;
Si on exclue &amp;quot;Denoise&amp;quot; , &amp;quot;Tone mapping&amp;quot; et &amp;quot;Retinex&amp;quot; et certains usages de &amp;quot;Wavelets&amp;quot;, les temps de traitement sont de l'ordre de quelques dixièmes de seconde par spot de contrôle, et le besoin en mémoire de l'ordre de quelques centaines de M.&lt;br /&gt;
&lt;br /&gt;
Deux réglages agissent fortement sur les temps de traitement et le besoin en mémoire :&lt;br /&gt;
* &amp;quot;mask&amp;quot; (&amp;quot;Color and Light&amp;quot;, &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;, &amp;quot;Shadows Highlight &amp;amp; Tone Equalizer&amp;quot;, &amp;quot;Contrast by detail levels&amp;quot;, &amp;quot;Tone mapping&amp;quot;, &amp;quot;Retinex&amp;quot;, &amp;quot;Tone mapping, &amp;quot;Blur/grain &amp;amp; Denoise&amp;quot;, &amp;quot;Log encoding&amp;quot;, &amp;quot;Local contrast &amp;amp; wavelets&amp;quot;, &amp;quot;Color appearance(Cam16 &amp;amp; JzczHz) accroît nettement les besoins en mémoire. Attention si votre machine a des capacités limitées et si vous sélectionnez une grande zone.&lt;br /&gt;
* l'option FFTW  (Retinex, Local contrast, Blur/grain...) même optimisée peut accroître ou réduire les temps de traitements - dans tous les cas elle améliore la qualité:&lt;br /&gt;
** pour des petites tailles et moyennes tailles de Spot (jusque 2000 * 2000 pixels) FFTW sera plus rapide&lt;br /&gt;
** pour les grandes tailles (5000 * 4000 pixels), FFTW sera plus lent&lt;br /&gt;
&lt;br /&gt;
=== Aspects logiciels ===&lt;br /&gt;
Comme le traitement est itératif pour chaque Rt-spot, il est important de connaître l'ordre&lt;br /&gt;
*  Log Encoding,  Blur/grain &amp;amp; Denoise, Contrast By Detail Level, Vibrance &amp;amp; Warm/cool, Tone mapping,  Shadow Highlight &amp;amp; Tone Equalizer, Soflight &amp;amp; Original Retinex, Local contrast &amp;amp; Wavelets, Sharp, Retinex, Dynamic Range &amp;amp; Exposure, Color &amp;amp; light, Common Color Mask, Color appearance(Cam16 &amp;amp; JzCzHz), Avoid color shift&lt;br /&gt;
* Comme évoqué dans le texte, certaines fonctions ont été réécrites, soit pour s'adapter à l'échelle, soit par qu'elle fonctionne en mode Lab au lieu de RGB.&lt;br /&gt;
&lt;br /&gt;
===Quelques questions ?===&lt;br /&gt;
&lt;br /&gt;
====Et le détourage des objets ?====&lt;br /&gt;
C'est une question fréquemment posée ! &lt;br /&gt;
* Dans une majorité de cas, l'algorithme de détection de forme sera largement suffisant pour ne sélectionner que ce qui est nécessaire, avec à la fois la commande &amp;quot;scope&amp;quot; et les curseurs prévus dans &amp;quot;settings&amp;quot; - shape detection et transition&lt;br /&gt;
* l'utilisation de &amp;quot;excluding spot&amp;quot; doit permettre de résoudre les cas délicats&lt;br /&gt;
* les masques prévus dans plusieurs modules - Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows Highlight &amp;amp; Tone Equalizer&amp;quot;, Vibrance &amp;amp; Warm/cool, Contrast by detail levels, Local contrast &amp;amp; Wavelets, Tone mapping, Blur/Grain &amp;amp; denoise, Log Encoding, Color Appearance(Cam16 &amp;amp; JzCzHz) doivent aussi permettre d'améliorer la sélection dans quelques cas.&lt;br /&gt;
* la sélection peut être encore améliorée en choisissant 2 spot, très proches mais chacun sur une &amp;quot;couleur&amp;quot; (au sens deltaE) différente, avec 2 masques complémentaires  &lt;br /&gt;
&lt;br /&gt;
Si un spécialiste GUI est capable par exemple d'agir sur les 4 ellipses et les transformer en courbes de Beziers (chacune inscrite dans le rectangle centre X Y), ou de réaliser un polygone (inscrit dans le rectangle centre X Y) à main levée alors avec une simple LUT on pourrait simuler un détourage... pour les irréductibles des détourages, calques...ET bien sûr (ce n'est pas le moindre problème) - modifier l'algorithme.&lt;br /&gt;
&lt;br /&gt;
====A quoi sert l'association Retinex - Dehaze ?====&lt;br /&gt;
Chacun des 2 algorithmes a ses points forts&lt;br /&gt;
* Dehaze est très performant globalement, mais &amp;quot;ignore&amp;quot; les arrières plans&lt;br /&gt;
* Retinex est performant sur la différenciation avant - arrière plan, mais peut produire du halo.&lt;br /&gt;
&lt;br /&gt;
La combinaison des 2 : Dehaze à partir de l'image globale (ou locale) et Retinex pour la partie locale de l'arrière plan, permet de résoudre la quasi totalité des cas&lt;br /&gt;
&lt;br /&gt;
Exemple d'utilisation pour une image brumeuse :[[Local Lab controls/fr#Traitement d'une image brumeuse| Exemple dans Premiers pas - Traiter une image brumeuse]]&lt;br /&gt;
&lt;br /&gt;
====Pourquoi y a-t-il un &amp;quot;masque&amp;quot; pour chacun des modules concernés et pas un &amp;quot;masque global&amp;quot; ? ====&lt;br /&gt;
Simplement parce que chacun des modules &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot; , &amp;quot;Color &amp;amp; Light&amp;quot;, etc.  subit les traitements récursif des autres modules - exactement comme l'ensemble des modules de Rawtherapee, interagissent l'un sur l'autre. J'ai fait une exception pour &amp;quot;Blur/grain &amp;amp; Denoise&amp;quot; qui ont en commun un masque, car: a) ils sont en début de processus &amp;quot;Local adjustements&amp;quot; et n'ont que peu d’interactions.&lt;br /&gt;
&lt;br /&gt;
Avoir un masque global, revient par comparaison à n'avoir qu'une seule courbe pour gérer l'ensemble des courbes de Rawtherapee.&lt;br /&gt;
&lt;br /&gt;
Bien sûr, par simplification, il n'y a que 11 modules avec &amp;quot;masques&amp;quot;, rien n'interdit de l'étendre aux autres...ce n'est qu'une question de temps...si la demande s'en fait sentir.&lt;br /&gt;
&lt;br /&gt;
====Pourquoi n'y a-t-il pas toutes les fonctions de Rawtherapee avec le mode &amp;quot;local&amp;quot; ?====&lt;br /&gt;
&lt;br /&gt;
Le mode local est fondé et articulé autour du concept &amp;quot;L*a*b*&amp;quot; et de la notion de deltaE (Lab nécessaire), une majorité de modules &amp;quot;principal&amp;quot; ont leur équivalent &amp;quot;local&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Par contre, les modules &amp;quot;rgb&amp;quot; après démosaicing ou &amp;quot;RGB&amp;quot; avant demosaicing nécessiterait une autre approche que le concept du deltaE. Donc rien d'impossible, par exemple pour réaliser un module &amp;quot;balance des blancs locale&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Comment modifier uniquement l'ensemble des feuillages d'une image ? ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fichier raw  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1rRcFYYihDjW0ZHadA9S0nNyt3vwxG1Yu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
L'algorithme permet de ne sélectionner qu'une couleur, par exemple les feuilles d'un arbre.&lt;br /&gt;
&lt;br /&gt;
Pour cela:&lt;br /&gt;
*la taille du spot doit être réduite pour ne cerner que la couleur concernée.&lt;br /&gt;
*Ajuster &amp;quot;scope&amp;quot; sur des valeurs faibles.&lt;br /&gt;
*Étendre l'action du RT-spot pour prendre en compte - si vous le souhaitez - l’ensemble des feuillages de l'image (par exemple si il y a plusieurs arbres)&lt;br /&gt;
*Agir sur les champs que vous souhaitez modifier (luminance, saturation, etc.)&lt;br /&gt;
&lt;br /&gt;
[[File:Horse-foliage .jpg|600px|thumb|center|Limiter action au feuillage d'un arbre]]&lt;br /&gt;
&lt;br /&gt;
Dans l'exemple ci-dessus: &lt;br /&gt;
Dans Settings:&lt;br /&gt;
* Spot size = 4&lt;br /&gt;
* Scope (color tools) = 9&lt;br /&gt;
&lt;br /&gt;
Dans Color &amp;amp; Light (mode Basic)&lt;br /&gt;
* Chrominance = 143&lt;br /&gt;
&lt;br /&gt;
====Comment réaliser la fonction &amp;quot;Clarté&amp;quot; (Clarity)====&lt;br /&gt;
Au moins 3 façons :&lt;br /&gt;
# en utilisant Contrast by Detail Level et en agissant sur &amp;quot;Residual image - Clarity&amp;quot; - effet &amp;quot;moyen&amp;quot;&lt;br /&gt;
# en utilisant Tone-Mapping - effet &amp;quot;fort&amp;quot; - notamment avec l'usage de gamma et amount et des valeurs modérées de &amp;quot;compression&amp;quot; (attention aux temps de traitement)&lt;br /&gt;
# en utilisant Local-contrast &amp;amp; wavelets - en agissant sur &amp;quot;Residual image - Clarity&amp;quot; - effet &amp;quot;moyen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Et pourquoi pas avec Retinex... qui est une autre manière de réaliser un &amp;quot;local contrast&amp;quot; - plus difficile à manipuler, mais l'algorithme de principe est proche.&lt;br /&gt;
&lt;br /&gt;
Un masque sur la totalité de l'image (ou partielle) peut permettre de modifier le gamma de l'image et affaiblir  - renforcer la luminance de certaines zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Un exemple avec Wavelet=====&lt;br /&gt;
Fichier raw (Copyright Sebastien Guyader -  Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
* Arbitrairement j'ai choisi dans Settings : &amp;quot;Full image&amp;quot;&lt;br /&gt;
* Ajouter l'outil : Local Contrast &amp;amp; Wavelet (mode Standard ou Advanced)&lt;br /&gt;
** positionner le Rt-spot sur la couleur que vous souhaitez privilégier&lt;br /&gt;
[[File:Clarity-wav-before.jpg|600px|thumb|center|Clarity avec Wavelet - avant action sur les curseurs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Clarity-wav.jpg|600px|thumb|center|Clarity avec Wavelet - avec action sur les curseurs]]&lt;br /&gt;
* J'ai choisi aussi arbitrairement de laisser Scope = 60, bien sûr vous pouvez le réduire ou l'augmenter.&lt;br /&gt;
* vous pouvez aussi bouger la position du RT-Spot.&lt;br /&gt;
* Merge Luma = 78.1&lt;br /&gt;
* Merge Chroma = 34.2&lt;br /&gt;
Là encore, vous faites ce que vous souhaitez, laisser Merge Chroma à 0, baisser Merge Luma&lt;br /&gt;
&lt;br /&gt;
Essayez de modifier le curseur &amp;quot;Wavelet levels&amp;quot; et observez les résultats&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10821</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10821"/>
		<updated>2024-11-10T15:29:16Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* An experimental JzCzHz module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Generalized Hyperbolic Stretch''' ===&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10820</id>
		<title>Local Adjustments</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Local_Adjustments&amp;diff=10820"/>
		<updated>2024-09-24T07:07:52Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The 4 types of RT-spot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Local Adjustments&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
02/02/2024&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Local editing in RawTherapee is based on RT-spots, which are similar in principle to the U-Point concept originally used in Nikon Capture NX2 and subsequently in the Nik Collection, DxO PhotoLab and Capture NXD. RT-spots use algorithms developed specifically for RawTherapee by Jacques Desmis.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This approach is completely different to the more familiar local editing methods used in applications such as GIMP, Photoshop, etc., which primarily use selection tools such as lassos, magic wands etc., associated with brushes, layers and blend masks. These methods can be time consuming and difficult to use accurately when complex shapes are involved.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An RT-spot consists of either an ellipse or a rectangle with a variable-diameter circle at the center. The shapes have four control points, which can be adjusted independently or symmetrically. The rectangle spot can also be used in full-image mode which automatically sets the control points outside the image preview area. Future developments will provide enhanced shape manipulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Two types of RT-spot shape&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
File:ellipse.jpg|Ellipse.&lt;br /&gt;
File:rectangle.jpg|Rectangle.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RT-spot algorithm uses shape detection based on ΔE (the change in the visual perception of two given colors) to select the parts of the image to be modified inside the ellipse or rectangle. The  reference values used for the shape detection algorithm are based on the average of the hue, chroma and luminance values inside the variable-diameter circle. This means that in full-image mode (and also in Normal or Excluding modes) these values and the subsequent shape detection can vary depending on the position of the circle.&lt;br /&gt;
&lt;br /&gt;
The extent to which these modifications are applied can be finely controlled allowing for very precise selections. Further refinement is possible with additional parametric masks but the shape-detection algorithms should be sufficient for the vast majority of local editing requirements. &lt;br /&gt;
RT-spots can also be used in Excluding mode to prevent the algorithm from influencing certain parts of the image.&lt;br /&gt;
The modifications that can be carried out are extensive and incorporate most of the functions available in RawTherapee's global adjustment tools along with some additional tools available only in the Local Adjustments tab.&lt;br /&gt;
&lt;br /&gt;
Note: provided the checkbox “Avoid color shift” in the Settings module has not been disabled, the following operations will be carried out on the data before and after any RT Spot is activated.&lt;br /&gt;
* A relative colorimetric correction to keep the data within gamut.&lt;br /&gt;
* A Munsell correction using LUTs to ensure that the data remains linear and avoid hue shifts.&lt;br /&gt;
&lt;br /&gt;
===The Tools===&lt;br /&gt;
The tools are grouped in the following modules (Tool name - position in pipeline):&lt;br /&gt;
&lt;br /&gt;
====Color &amp;amp; Light - 11====&lt;br /&gt;
&lt;br /&gt;
Adjust color, lightness, contrast and correct small defects such as red-eye, sensor dust etc. Other functions include a graduated filter, L*a*b* curves and blend modes. &lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights &amp;amp; Tone Equalizer - 6====&lt;br /&gt;
&lt;br /&gt;
Adjust shadows &amp;amp; highlights with either the shadows/highlights sliders, a Tone Equalizer or a Tone Response Curve (TRC). Can be used instead of, or in conjunction with the Exposure module. Can also be used as a graduated filter.&lt;br /&gt;
&lt;br /&gt;
====Vibrance &amp;amp; Warm/Cool - 5====&lt;br /&gt;
&lt;br /&gt;
Adjust vibrance (essentially the same as the global adjustment). Carry out the equivalent of a white-balance adjustment using a CIECAM algorithm.&lt;br /&gt;
&lt;br /&gt;
====Log Encoding - 0====&lt;br /&gt;
&lt;br /&gt;
Adjust underexposed or high-dynamic-range images using a log-encoded algorithm.&lt;br /&gt;
&lt;br /&gt;
====Dynamic Range &amp;amp; Exposure - 10====&lt;br /&gt;
&lt;br /&gt;
Modify exposure in L*a*b* space using Laplacian PDE algorithms to take into account deltaE and  minimize artifacts.&lt;br /&gt;
Laplacian operators are used because they are particularly good at detecting fine details but you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
====Common Color Mask - 12====&lt;br /&gt;
&lt;br /&gt;
A tool in its own right. Can be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope.&lt;br /&gt;
&lt;br /&gt;
====Soft Light &amp;amp; Original Retinex - 7====&lt;br /&gt;
&lt;br /&gt;
Apply a Soft-light blend (identical to the global adjustment). Carry out dodge and burn using the original Retinex algorithm.&lt;br /&gt;
&lt;br /&gt;
====Blur/Grain &amp;amp; Denoise - 1====&lt;br /&gt;
&lt;br /&gt;
Can be used to blur backgrounds, soften skin, add film grain and denoise.&lt;br /&gt;
&lt;br /&gt;
====Tone Mapping - 2====&lt;br /&gt;
&lt;br /&gt;
Same as the tone mapping tool in the main menu. The main menu tool must be deactivated if this tool is used.&lt;br /&gt;
&lt;br /&gt;
====Dehaze &amp;amp; Retinex - 3====&lt;br /&gt;
&lt;br /&gt;
Dehaze and Retinex (Advanced mode only). Useful for dehaze, local contrast with high values and simulation of &amp;quot;clarity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
====Sharpening - 8====&lt;br /&gt;
&lt;br /&gt;
Uses RL deconvolution sharpening. View at 1:1&lt;br /&gt;
&lt;br /&gt;
====Local Contrast &amp;amp; Wavelets - 8====&lt;br /&gt;
&lt;br /&gt;
* Local Contrast: basically the same functions as Local Contrast in the Detail tab.&lt;br /&gt;
* Wavelets: based on Wavelet Levels in the Advanced tab with essentially the same features (clarity, contrast, blur, etc., see documentation). Additional features such as a Graduated Filter, Tone mapping, etc. have also been included. Its use in Local Adjustments provides additional possibilities such as the removal of large blemishes, grease stains etc.&lt;br /&gt;
&lt;br /&gt;
====Contrast By Detail Levels - 4====&lt;br /&gt;
&lt;br /&gt;
Contrast by detail levels. Can be used to remove sensor or lens marks.&lt;br /&gt;
&lt;br /&gt;
====Color appearance(Cam16 &amp;amp; Jzcz) - 12====&lt;br /&gt;
This module is a simplified version of the Color Appearance &amp;amp; Lighting(Ciecam02/16) module in the Advanced tab in the main menu, which has been adapted to the specific requirements of Local Adjustments. It has also been extended to take into account HDR Peak Luminance and includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
&lt;br /&gt;
Each tool module can be toggled between Basic, Standard &amp;amp; Advanced modes. The default mode can be set in RawTherapee's Preferences window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The examples in the following  sections are designed to give an overview of some of the ways the various tools can be used for local adjustments. However, if you prefer to explore the possibilities by yourself, check that the “Default complexity for Local Adjustments” in the Preferences module is set to Basic and uncheck the &amp;quot;Show additional settings&amp;quot; checkbox at the top of the Local Adjustments module. This will give you a simplified yet powerful version of Local Adjustments. &lt;br /&gt;
	&lt;br /&gt;
The Basic mode, which has no masks and in most cases no curves, is the closest to the original intention of Jacques Desmis when development started back in 2015. &lt;br /&gt;
&lt;br /&gt;
Explore the capabilities of the Color &amp;amp; Light, &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; and 	&amp;quot;Vibrance &amp;amp; Warm/Cool&amp;quot; tools to start with and don't hesitate to try out the additional functionality by manually setting the complexity mode to Standard (in the combobox in the module you are working on).&lt;br /&gt;
 &lt;br /&gt;
The Color &amp;amp; Light tool is extremely powerful and includes functions from both the &amp;quot;Color 	Toning &amp;gt; Color correction regions&amp;quot; module in the main-menu Color tab as well as the 	L*a*b* curves available in the Exposure tab&lt;br /&gt;
&lt;br /&gt;
Please note: the screenshots in the following examples are currently being updated to take into account the latest developments. Because of this, some of the slider and module names will be different from the text.&lt;br /&gt;
&lt;br /&gt;
===First steps===&lt;br /&gt;
====Activating Local Adjustments====&lt;br /&gt;
&lt;br /&gt;
* In the Tab tool bar, select the &amp;quot;hand&amp;quot; icon (Local Adjustments tab). &lt;br /&gt;
* Turn on the Local Adjustments power button (if it is not already activated) and expand the Settings module. &lt;br /&gt;
*Select Add.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul class=&amp;quot;leftalign&amp;quot;&amp;gt; &lt;br /&gt;
[[File:startspot.jpg|600px|thumb|center|Original]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Choose the type of Spot====&lt;br /&gt;
[[Local_Adjustments#The_4_types_of_RT-spot | The four types of RT-spot]]&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Position the RT-spot at the desired location. In this case, we want to increase the saturation of the red flower and reduce the luminance (lightness) without affecting the rest of the image. &lt;br /&gt;
* Move the center of the RT-spot so that it is located on an area representative of what you want to change. &lt;br /&gt;
* Position the 4 delimiters well beyond the flower. &lt;br /&gt;
* Select the Lockable Color Picker and locate 3 colors: a) one on the red flower, b) one on the blue sky, c) one on a green leaf. &lt;br /&gt;
* In the example the 3 colors are: &lt;br /&gt;
** Red flower L=48.6 a=74.4 b=47.0&lt;br /&gt;
** Blue sky : L=68.6 a=-3.1 b=-16.6&lt;br /&gt;
** Green leaf : L=48.3 a=-28.3 b=51.4 &lt;br /&gt;
[[File:prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding the Color &amp;amp; Light tool====&lt;br /&gt;
&lt;br /&gt;
In the settings menu, choose &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* You will see a list of choices: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer etc. For each RT-spot you can associate one or more tools from the list. The processing order in the pipeline corresponds to the number at the end of the tool description as described in the Introduction: Log Encoding - 0 is first (if it is activated), Color &amp;amp; Light -11 is the last. This is also the case for the associated masks. &lt;br /&gt;
* Select Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
[[File:addtoolcolorandlight1.jpg|600px|thumb|center|Adding the Color &amp;amp; Light tool]]&lt;br /&gt;
&lt;br /&gt;
====Adjusting luminance (lightness) and chrominance====&lt;br /&gt;
&lt;br /&gt;
* Set Lightness to -70 &lt;br /&gt;
* Set Chrominance to 130&lt;br /&gt;
&lt;br /&gt;
* Review the results.&lt;br /&gt;
* The red flower now has a new color L= 41.3, a = 66.0, b = 50.4&lt;br /&gt;
* The sky is unchanged. &lt;br /&gt;
* The green leaf is unchanged.&lt;br /&gt;
&lt;br /&gt;
[[File:lightchro1.jpg|600px|thumb|center|Adjusting luminance (lightness) and chrominance]]&lt;br /&gt;
&lt;br /&gt;
====Color Tool Scope and Transition Value====&lt;br /&gt;
&lt;br /&gt;
In the Settings module: &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Scope (color tools)&amp;quot; slider.&lt;br /&gt;
** If you reduce the value (default 30) only a part of the reds will be affected. &lt;br /&gt;
** If you increase the value, the sky, then the green leaf, then the whole image will be taken into account (Scope=100).&lt;br /&gt;
Leave the Scope value at 100 and in the Settings module select &amp;quot;Show additional settings&amp;quot;. &lt;br /&gt;
* Observe the effect of moving the &amp;quot;Transition value&amp;quot; slider:&lt;br /&gt;
** Reduce the value to 5. &lt;br /&gt;
** Increase the value to 100 and see the result.&lt;br /&gt;
&lt;br /&gt;
====Previewing the adjustment area using deltaE (ΔE)====&lt;br /&gt;
&lt;br /&gt;
You can preview the areas of the image that will be affected by any changes. The preview does not show the changes themselves or the transitions, but allows you to set the scope of any adjustments. &lt;br /&gt;
&lt;br /&gt;
There are two possibilities. &lt;br /&gt;
* Use the Preview ΔE button located in Settings. This will only work properly if you have activated one (and only one) of the color tools in &amp;quot;Add tool to current spot&amp;quot; menu. &lt;br /&gt;
* Use the Preview ΔE option in the &amp;quot;Mask and modifications&amp;quot; menu associated with a particular tool (standard and advanced modes only). In this case the GUI takes into account any adjustments made with the tool and works regardless of the number of activated tools.&lt;br /&gt;
&lt;br /&gt;
You can vary the intensity and color of this preview with &amp;quot;ΔE preview color &amp;quot; in the &amp;quot;Shape detection&amp;quot; section of the Settings module. The preview will also let you see the effect of varying the other sliders in the “Shape detection” section.  &lt;br /&gt;
&lt;br /&gt;
[[File:previewdeltae1.jpg|600px|thumb|center|Previewing the modifiable area]]&lt;br /&gt;
&lt;br /&gt;
====Viewing the changes====&lt;br /&gt;
&lt;br /&gt;
To see the changes:&lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot; (don't forget to select either Standard or Advanced in the Color &amp;amp; Light combobox) .&lt;br /&gt;
&lt;br /&gt;
* You can see the effects of any changes to luminance, contrast, color and saturation, as well as any changes to the texture or structure of the image.&lt;br /&gt;
* You can also see the effect of the transition settings.&lt;br /&gt;
** &amp;quot;Transition value&amp;quot;: percentage of the area that will receive the full effect of any adjustments before dropping off to zero.&lt;br /&gt;
** &amp;quot;Transition decay&amp;quot;: the rate with which the zone of influence decreases.&lt;br /&gt;
** &amp;quot;Transition differentiation XY&amp;quot;: difference in coverage between abscissa and ordinate.&lt;br /&gt;
&lt;br /&gt;
Try out the following and observe the effect. &lt;br /&gt;
* Change the &amp;quot;Scope (color tools)&amp;quot;. Remember that the scope slider acts on deltaE. &lt;br /&gt;
* Transition settings. &lt;br /&gt;
* Tool settings (luminance, chroma, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:showmodif.jpg|600px|thumb|center|Viewing the modified areas]]&lt;br /&gt;
&lt;br /&gt;
====Working on the full image using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
Local adjustments are not limited to local touch-ups. You can also use the Local Adjustments tool to process the full image. &lt;br /&gt;
&lt;br /&gt;
In Settings enable &amp;quot;Show additional settings&amp;quot;: &lt;br /&gt;
* Set the &amp;quot;RT-spot shape&amp;quot; to “Full image” &lt;br /&gt;
* This will set the 4 delimiters outside of the preview &lt;br /&gt;
* It will also set the transition to 100 (you can use another value if you wish to generate a gradient, bearing in mind that there are other tools for making gradients). You are now ready to use all the tools in full-image mode. &lt;br /&gt;
&lt;br /&gt;
[[File:fullim1.jpg|600px|thumb|center|Working on the complete image - settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Combining tools in a single spot====&lt;br /&gt;
Most of the local-adjustment tools can be used together in the same RT-spot. However, combinations of Log Encoding, Tone Mapping and Retinex should be avoided. This is because the output TIFF or JPG may not correspond to the Preview particularly when the Preview has been magnified using the zoom function. &lt;br /&gt;
Associating any one of the above tools with the other local-adjustment tools such as Color &amp;amp; Light, does not pose a problem. &lt;br /&gt;
If you do wish to use combinations of the 3 tools mentioned above you can simply add another RT-spot in close proximity to the first one. &lt;br /&gt;
For example, the first RT-spot could be dedicated to Log Encoding, and the second dedicated to Tone Mapping or Retinex. Other tools can be added to either of the two RT-spots as required.&lt;br /&gt;
&lt;br /&gt;
===Worked examples===&lt;br /&gt;
====Example: changing the color of all the green leaves, except for one====&lt;br /&gt;
&lt;br /&gt;
=====Changing the color of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* You can use the &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components of &amp;quot;Lab&amp;quot; in the &amp;quot;Color correction grid &amp;quot;, by choosing Direct (combobox under the grid) and a high value of Strength. Moving the dots on the grid as shown will change the color of all the leaves. &lt;br /&gt;
* You can adjust if necessary with &amp;quot;Scope (color tools)&amp;quot;. &lt;br /&gt;
* The other colors in the flower, sky etc., are not modified.&lt;br /&gt;
&lt;br /&gt;
[[File:colorleav1.jpg|600px|thumb|center|Changing the color of the leaves]]&lt;br /&gt;
&lt;br /&gt;
=====Restoring the green color to one of the leaves=====&lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot (Add in the Settings module).&lt;br /&gt;
* Choose &amp;quot;Spot method&amp;quot; = &amp;quot;Excluding spot&amp;quot;. &lt;br /&gt;
* Move the RT-spot to the leaf to be changed and expand the spot well beyond the edges of the leaf.&lt;br /&gt;
* Adjust Scope (under the Excluding heading in Settings) until you get the desired effect. &lt;br /&gt;
* If you wish, you can use the Excluding spot in the same way as a normal RT-spot and add tools such as Denoise, Blur, etc. (i.e. it not only “excludes&amp;quot; the effect of the adjacent spot, but it also allows you to use it in the same way as normal spot for the area it encompasses).&lt;br /&gt;
&lt;br /&gt;
[[File:excluding1.jpg|600px|thumb|center|Using the Excluding spot]]&lt;br /&gt;
&lt;br /&gt;
====Correcting red-eye and removing sensor defects====&lt;br /&gt;
&lt;br /&gt;
3 steps: preparation, RT-spot adjustment, red-eye removal. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose a large area around the eye.&lt;br /&gt;
* Put the RT-spot on the red area of the eye (pupil). &lt;br /&gt;
* Set 4 Lockable Color Pickers so that you can see the changes.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_prepare1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the RT-spot=====&lt;br /&gt;
&lt;br /&gt;
* Add the Color &amp;amp; Light tool. &lt;br /&gt;
* Press the &amp;quot;Preview deltaE&amp;quot; button in Settings. &lt;br /&gt;
* Adjust the RT-spot to obtain the desired level of selection.&lt;br /&gt;
** In this example we have chosen to reduce the spot size to 14.&lt;br /&gt;
** &amp;quot;Scope (color tools)&amp;quot; = 18.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye_previewdE1.jpg|600px|thumb|center|Preview dE]]&lt;br /&gt;
&lt;br /&gt;
=====Removing the red color=====&lt;br /&gt;
&lt;br /&gt;
* In the Color and Light tool, reduce the chrominance to -100. &lt;br /&gt;
* Observe the result. &lt;br /&gt;
** The pupil of the eye has almost no dominant color anymore.&lt;br /&gt;
** The iris, cornea and facial skin are unchanged.&lt;br /&gt;
** You may need to change the &amp;quot;Transition value&amp;quot; (lower it) and &amp;quot;Transition decay&amp;quot; (increase it) in &amp;quot;Settings&amp;quot; depending on the case.&lt;br /&gt;
&lt;br /&gt;
[[File:Redeye1.jpg|600px|thumb|center|Eye with red color removed]]&lt;br /&gt;
&lt;br /&gt;
=====Removing sensor defects or spots=====&lt;br /&gt;
&lt;br /&gt;
The principle is the same as above for removing small sensor faults but in this example we will use different tools. &lt;br /&gt;
* Either CBDL (Contrast By Detail Levels), &lt;br /&gt;
* or Wavelet Pyramid2 &amp;gt; “Contrast by level” (Advanced).&lt;br /&gt;
* In both cases, reduce the contrast for the lower levels of decomposition.&lt;br /&gt;
* Adjust &amp;quot;Blur levels&amp;quot; if necessary (Wavelet Pyramid1). &lt;br /&gt;
* Use a low &amp;quot;Transition value&amp;quot; (less than 20) and high &amp;quot;Transition decay&amp;quot; (greater than 15) in the Settings module. &lt;br /&gt;
* The minimum size of the RT-spot for the CBDL and Wavelet Pyramid2 decomposition to function is 32x32 pixels. There are workarounds such as the use of transitions and deltaE to deal with defects smaller than the spot.&lt;br /&gt;
&lt;br /&gt;
Example: removing multiple spots using Wavelet Pyramid2.&lt;br /&gt;
* Looking at the image below, we can see that it is blotchy.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotches.jpg|600px|thumb|center|Multiple blotches]]&lt;br /&gt;
&lt;br /&gt;
* A possible solution:&lt;br /&gt;
** Activate the tool Local Contrast &amp;amp; Wavelets. &lt;br /&gt;
** Choose Advanced in the first combobox and then Wavelets in the second combobox.&lt;br /&gt;
** Adjust Scope to 20.&lt;br /&gt;
** Go to Pyramid2 and activate &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
** Set high values of &amp;quot;Attenuation response&amp;quot;, Offset and &amp;quot;Chroma levels&amp;quot; (if necessary).&lt;br /&gt;
** Activate the &amp;quot;Contrast by level&amp;quot; curve and reduce the contrast for the lower levels.&lt;br /&gt;
&lt;br /&gt;
[[File:Blotchesless1.jpg|600px|thumb|center|Fewer blotches]]&lt;br /&gt;
&lt;br /&gt;
====Dodging and Burning====&lt;br /&gt;
&lt;br /&gt;
In many portraits, or photos where light falls directly on the skin, an unpleasant contrast-enhancement phenomenon occurs. Some parts of the skin are slightly overexposed, while others are slightly underexposed. &lt;br /&gt;
* Traditionally this problem is treated with masks and layers and there are numerous tutorials for doing this with the GIMP and Photoshop (c). You could probably use RawTherapee's Local Adjustments masks also.&lt;br /&gt;
* Here we are going to use the Original Retinex concept (based on Ipol research). It was developed in the 1970s and was originally designed for this sort of application and not for the way it has been subsequently used in Rawtherapee and elsewhere. We are going to:&lt;br /&gt;
** Use one or more adjustable-threshold Laplacian functions (see note below).&lt;br /&gt;
** Solve the Poisson equation (PDE - Partial Derivative Equation).&lt;br /&gt;
** Balance the luminance values.&lt;br /&gt;
&lt;br /&gt;
Note: Laplacian operators are used because they are particularly good at detecting fine details and Poisson equations are used to solve the partial differential equation generated by the Laplacian and make the tool usable. But you do not need to understand how they work to use this tool!&lt;br /&gt;
&lt;br /&gt;
There are 3 steps: Preparation, Laplacian settings and preview, Result &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* The deltaE adjustment, the Scope (make sure you use the Original Retinex Scope) and the transition adjustment principles are identical to the previous examples and won't be repeated here. &lt;br /&gt;
* The portrait we are going to use has had the eyes masked for confidentiality reasons. &lt;br /&gt;
* Choose &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Soft Light &amp;amp; Original Retinex &amp;gt; Advanced &amp;gt; Original Retinex.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburn1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Laplacian threshold and viewing the changes=====&lt;br /&gt;
&lt;br /&gt;
* Adjust the Strength slider (which takes into account the threshold of the first Laplacian operator). &lt;br /&gt;
* Adjust the &amp;quot;Laplacian threshold deltaE&amp;quot; slider (which takes into account the deltaE of the image to act on a second Laplacian operator). This processing is upstream of the Scope algorithms and can take into account differences in the background.&lt;br /&gt;
* View the modifications by choosing: &amp;quot;Show Fourier process&amp;quot; &amp;gt; &amp;quot;Show modifications without mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnshow1.jpg|600px|thumb|center|Show Modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Results=====&lt;br /&gt;
&lt;br /&gt;
[[File:Dodgeburnmodif1.jpg|600px|thumb|center|Results]]&lt;br /&gt;
A similar algorithm is used in the Dynamic Range &amp;amp; Exposure tool. It can be used to process images with large differences in exposure that are often globally underexposed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making a graduated filter based on luminance, chrominance and hue (gradient filter)====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Choose the flower image that was used in the first example.&lt;br /&gt;
* Identify 7 points with the &amp;quot;Lockable color picker&amp;quot;.&lt;br /&gt;
* Add the Color &amp;amp; Light tool to the current spot and select “Advanced” mode.&lt;br /&gt;
[[File:gradprepa1.jpg|600px|thumb|center|Preparation]] &lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1X2g73FqzQl7-WRfzhF7zHa7XWwnKcwtx/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Making a graduated filter=====&lt;br /&gt;
&lt;br /&gt;
Arbitrarily we have chosen the following settings:&lt;br /&gt;
* Luminance gradient strength = -0.44 &lt;br /&gt;
* Chrominance gradient strength = -1.13 &lt;br /&gt;
* Hue gradient strength = 2.69&lt;br /&gt;
* Gradient angle = -87.6&lt;br /&gt;
* Scope (color tools) = 30&lt;br /&gt;
* Feather gradient(settings) = 25&lt;br /&gt;
[[File:gradLCH1.jpg|600px|thumb|center|Luminance, Chrominance &amp;amp; Hue Gradient]] &lt;br /&gt;
 &lt;br /&gt;
=====Changing the default settings=====&lt;br /&gt;
&lt;br /&gt;
* Try to gradually change &amp;quot;Scope (color tools)&amp;quot; by increasing the value to 70 then 75, 80, 85, 90 and 100. &lt;br /&gt;
* Change &amp;quot;Feather gradient&amp;quot; in the Settings &amp;gt; Transition Gradient module and note the variations. &lt;br /&gt;
* You can also change the values of the gradients (L, C, H, angle) in the Graduated Filter section of the Color &amp;amp; Light tool).  &lt;br /&gt;
* If you wish, you can also change the values of Color &amp;amp; Light.&lt;br /&gt;
[[File:gradLCHScopeFeather1.jpg|600px|thumb|center|The settings for Transition, Gradient, Luminance, Chrominance, Hue, Scope &amp;amp; Feather]]&lt;br /&gt;
&lt;br /&gt;
====Five ways to change the exposure and lift the shadows====&lt;br /&gt;
&lt;br /&gt;
This example is for demonstration purposes only so that we can see the various (non-exhaustive) possibilities for adjusting exposure. The settings are arbitrary. &lt;br /&gt;
* The image is a difficult one with deep shadows and a central area that is almost overexposed. &lt;br /&gt;
* Five possible methods are shown with arbitrary settings: &lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Equalizer&lt;br /&gt;
** TRC (Tone Response Curve)&lt;br /&gt;
** Log Encoding&lt;br /&gt;
** Exposure (PDE algorithms &amp;amp; Exposure) &lt;br /&gt;
&lt;br /&gt;
We could also have used:&lt;br /&gt;
* Contrast curves, &lt;br /&gt;
* or lifted the shadows with &amp;quot;Lightness&amp;quot; (Color and Light), &lt;br /&gt;
* or used a graduated luminance filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* Add a spot as shown in the image below.&lt;br /&gt;
* Set the  &amp;quot;Scope (color tools)&amp;quot; slider to 50 (this value will be used by the  Shadows/Highlights tool when it is added and we will use the separate Scope sliders for each of the Log Encoding and Exposure tools).&lt;br /&gt;
* Try varying this value between 20 and 100&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-prepa1.jpg|600px|thumb|center|Lifting the shadows - preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Shadows/Highlights=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot; &amp;gt; &amp;quot;Standard&amp;quot;&lt;br /&gt;
* Select Shadows/Highlights in the combobox.&lt;br /&gt;
* Try changing &amp;quot;Shadows tonal width&amp;quot; and &amp;quot;Highlights&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-sh1.jpg|600px|thumb|center|Lifting the shadows - Shadows Highlights]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Equalizer=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select Tone Equalizer in the combobox.&lt;br /&gt;
* Try also sliders 2, 3 et 4.&lt;br /&gt;
[[File:shadows-toneeq2.jpg|600px|thumb|center|Lifting the shadows - Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
=====Using the Tone Response Curve (TRC)=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Shadows/Highlights &amp;amp; Tone Equalizer&amp;quot;.&lt;br /&gt;
* Select TRC.&lt;br /&gt;
* Increase the &amp;quot;Slope&amp;quot; to 150 and then come back to 60. &lt;br /&gt;
* Try reducing and then increasing the gamma and observe the effect.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-trc1.jpg|600px|thumb|center|Lifting the shadows - TRC]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Log Encoding.&lt;br /&gt;
* Note that the Scope slider in this case is in the Log Encoding tool: set Scope to 50.&lt;br /&gt;
* Click on the Automatic button.&lt;br /&gt;
* Adjust the “Target gray point” (now called “Mean luminance (Yb%)” in the Viewing Conditions panel).&lt;br /&gt;
[[File:shadows-elog1.jpg|600px|thumb|center|Lifting the shadows – Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
=====Using Exposure=====&lt;br /&gt;
&lt;br /&gt;
* “Add tool to current spot” &amp;gt; &amp;quot;Dynamic Range &amp;amp; Exposure&amp;quot;. &lt;br /&gt;
* Select Standard.&lt;br /&gt;
* Adjust &amp;quot;Exposure compensation ƒ&amp;quot; (a Laplacian and a Fourier transform will be applied).&lt;br /&gt;
* Set the Exposure Tools sliders to Black = -1500, Shadows = 50. &lt;br /&gt;
* By default &amp;quot;Highlight compression&amp;quot; is 20. Vary it to see the effect. &lt;br /&gt;
* Play around with the above settings to get a feeling for how the tool works.&lt;br /&gt;
&lt;br /&gt;
[[File:shadows-expo1.jpg|600px|thumb|center|Lifting the shadows - Exposure]]&lt;br /&gt;
&lt;br /&gt;
=====Recommendations=====&lt;br /&gt;
&lt;br /&gt;
For portraits and images with low color contrast: &lt;br /&gt;
* Use the Exposure slider with care because the algorithm (which is similar to the one used in the Exposure tab) is not well adapted to cases such as portraits which have subtle color variations in skin tones. The algorithm was improved recently (July 5, 2020) by the addition of a Laplacian operator to resolve the differences in contrast but it is still not the best solution for these cases. &lt;br /&gt;
&lt;br /&gt;
Despite the improvements and in general:&lt;br /&gt;
* The performance of the Exposure algorithm isn’t optimal. However, users are used to it so I have implemented some workarounds to improve the behaviour.&lt;br /&gt;
* Some simple alternatives include:&lt;br /&gt;
** The Tone Equalizer - in Shadows/Highlights &amp;amp; Tone Equalizer&lt;br /&gt;
** The Tone Response Curve (TRC) - also in Shadows/Highlights &amp;amp; Tone Equalizer (with the Equalizer in Standard mode). You can increase the Slope to linearly open up the shadows. You can also use the Gamma slider to lighten the bright areas.&lt;br /&gt;
&lt;br /&gt;
If you do use Exposure, then it is recommended (but not mandatory) to change the parameters of &amp;quot;Shape detection&amp;quot; in Settings as follows: &lt;br /&gt;
* Increase &amp;quot;ΔE-scope threshold&amp;quot;. &lt;br /&gt;
* Reduce &amp;quot;ΔE decay&amp;quot;.&lt;br /&gt;
* Set &amp;quot;ab-L balance (ΔE)&amp;quot; to L. &lt;br /&gt;
* Adjust &amp;quot;Scope (color tools)&amp;quot; if necessary.&lt;br /&gt;
&lt;br /&gt;
=====An evaluation of the dynamic-range capabilities of tools in Selective Editing=====&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Color Appearance - Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=80.9 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool does not impact the dynamic range.&lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 60&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the difference with Log Encoding, which changes the luminance distribution due to the action of Ciecam.&lt;br /&gt;
* Using the TRC Gamma slider  substantially restores the Log Encoding image above.&lt;br /&gt;
* Alternatively, you can use the Contrast J and Luminance J sliders.&lt;br /&gt;
[[File:sweep-rgb-cie.jpg|600px|thumb|center|With Cam16]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Equalizer======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=82 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool, slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 18Ev.&lt;br /&gt;
* Note the use of a fifth slider to handle very bright highlights: 5(lightest) = -100.&lt;br /&gt;
[[File:sweep-rgb-te.jpg|600px|thumb|center|With Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=4 to L=95.8 (scale 0 – 100).&lt;br /&gt;
* The colors do not seem to be evenly distributed in accordance with the luminance and color (color shift in the blues). The use of this L*a*b* tool slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 17Ev to 20Ev.&lt;br /&gt;
* Note the complexity and lack of intuitiveness of the adjustments and the long processing time.&lt;br /&gt;
[[File:sweep-rgb-drexp1.jpg|600px|thumb|center|With Dynamic Range and Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dehaze======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=88 (scale 0 – 100). There is not much detail in the shadows&lt;br /&gt;
* The colors do not appear to be evenly distributed in accordance with the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 15Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-deha.jpg|600px|thumb|center|With Dehaze]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Shadows/Highlights======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of this L*a*b* tool, impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-sh.jpg|600px|thumb|center|With Shadows/Highlights]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve - TRC - and TRC Cam16======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=95.6 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 12Ev to 16Ev.&lt;br /&gt;
[[File:sweep-rgb-trc.jpg|600px|thumb|center|With TRC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* TRC Cam16&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=98.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 20Ev to 22Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 80&amp;quot; and &amp;quot;Smooth highlights&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-trc-cam16.jpg|600px|thumb|center|With TRC and Smooth highlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Slope based - Cam16======&lt;br /&gt;
* Slope based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=2.4 to L=98.3 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 23Ev to 24Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-slope1-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Slope based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Response Curve and Highlight attenuation - Sigmoid based - Cam16======&lt;br /&gt;
* Sigmoid based&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=3.0 to L=98.1 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of this L*a*b* tool only slightly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the rendered blacks, whites and color is approximately 21.5Ev to 22.5Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 100&amp;quot; and &amp;quot;Black distribution = 89&amp;quot;&lt;br /&gt;
[[File:sweep-rgb-trc-sigmoid-based.jpg|600px|thumb|center|With TRC and Highlight attenuation - Sigmoid based]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Dynamic Range &amp;amp; Exposure : Exposure only======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=70.9 (scale 0 – 100).&lt;br /&gt;
* The colors, as a function of luminance, don't appear to be faithful or evenly distributed. The use of this L*a*b* tool severely impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 11Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-exp.jpg|600px|thumb|center|With Exposure]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Tone Mapping======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy part of the visible range from L=1 to L=72.4 (scale 0 – 100).&lt;br /&gt;
* The colors do not appear to be evenly distributed as a function of the luminance. The use of L*a*b*, severly impacts the dynamic range.&lt;br /&gt;
* The dynamic range of the restored blacks, whites and color is approximately 10Ev to 14Ev.&lt;br /&gt;
[[File:sweep-rgb-tm.jpg|600px|thumb|center|With Tone Mapping]]&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
* Tools using the log-encoding algorithm, such as the local-adjustments Log Encoding or Color-Appearance Cam16 tools, fully reproduce the color and dynamic range but they are not intuitive to use. &lt;br /&gt;
* The local-adjustments TRC tool in Cam16 almost completely reproduces the color and dynamic range. The tool should be suitable for a number of cases. Operation is quite simple and intuitive.&lt;br /&gt;
* The local-adjustments Tone Equalizer ensures fairly good restitution for this image. The tool should be suitable for most camera images. It's intuitive, but requires at least 5 settings.&lt;br /&gt;
* The local-adjustments Dynamic Range &amp;amp; Exposure tool has very good dynamic range reproduction, although some colors drift. Adjustments are not very intuitive, and the system is slow.&lt;br /&gt;
* The local-adjustments TRC tool provides average rendition for this image but should be suitable in a number of cases. Operation is simple and intuitive.&lt;br /&gt;
* The local-adjustments Slope tools, and Sigmoid tools provides average or very good rendition for this image. These tools should be suitable in a number of cases. Operation is quite simple, but not very intuitive.They require the use of an upstream tool like TRC tools.&lt;br /&gt;
* The local-adjustments Dehaze tool can have a significant effect on the dynamic range when it is used for its intended purpose i.e. dehaze.&lt;br /&gt;
* The other local-adjustment tools Exposure and Shadows/Highlights are of little interest in so far as dynamic range is concerned&lt;br /&gt;
* Curiously, one of the tools that is &amp;quot;dedicated&amp;quot; (in theory) to dynamic range reduction, i.e. Tone Mapping, doesn't give good results.&lt;br /&gt;
&lt;br /&gt;
====Processing a hazy image====&lt;br /&gt;
&lt;br /&gt;
We are going to process a very hazy image by first applying the global Haze Removal tool in the Detail tab and then touch up the sky and horizon using Retinex in Local Adjustments. &lt;br /&gt;
&lt;br /&gt;
=====Original Image=====&lt;br /&gt;
&lt;br /&gt;
[[File:haze.jpg|600px|thumb|center|Hazy image]]&lt;br /&gt;
&lt;br /&gt;
Raw file :(Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1tc9TxHGwYnVQ2OwiTZIiszDOEXfDjkh6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Processing with the Haze Removal tool (Detail tab in the main menu)=====&lt;br /&gt;
&lt;br /&gt;
We could have used the Dehaze tool in Local Adjustments but when you look at the image there is a lot of haze in the background and the hills so it is better to use a two-step approach.&lt;br /&gt;
&lt;br /&gt;
[[File:haze-dehaze.jpg|600px|thumb|center|Hazy image – result with the Haze Removal tool in the main menu (Detail tab)]]&lt;br /&gt;
&lt;br /&gt;
=====Additional processing with local Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced.&lt;br /&gt;
* Try varying the settings. &lt;br /&gt;
* Adjust the &amp;quot;Transmission map&amp;quot; curve in Advanced Retinex Tools if necessary by increasing the attenuation on the right side of the curve. &lt;br /&gt;
* Now look at the difference in the hills and the sky on the horizon!&lt;br /&gt;
&lt;br /&gt;
[[File:haze-reti1.jpg|600px|thumb|center|Hazy image after using Haze removal + Retinex]]&lt;br /&gt;
&lt;br /&gt;
====Using the Denoise module====&lt;br /&gt;
&lt;br /&gt;
There are several ways of using this tool:&lt;br /&gt;
* On selected areas to refine any denoising adjustments carried out with the Noise Reduction module in the Detail tab. In this case keep the Detail tab noise reduction to a minimum.&lt;br /&gt;
* By processing the whole image using the Denoise module in Local Adjustments and excluding parts of the image with an Excluding spot. &lt;br /&gt;
* By using it on its own to reduce noise in low-noise images. For example, to remove noise from the sky or a face.&lt;br /&gt;
* By using it on its own to reduce the noise in a selected area and deliberately leaving the noise in the rest of the image for artistic purposes.&lt;br /&gt;
We are going to look at an example using this last case.&lt;br /&gt;
&lt;br /&gt;
The image of the young girl is particularly noisy and has strong chromatic noise.&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-prepa1.jpg|600px|thumb|center|Denoise preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1poZporRNILcYfab1Y_f1i-SIEB4acn6L/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Zoom 100%=====&lt;br /&gt;
&lt;br /&gt;
[[File:denoise-zoom1.jpg|600px|thumb|center|Denoise zoom 100%]]&lt;br /&gt;
&lt;br /&gt;
=====Which settings should we use for denoising?=====&lt;br /&gt;
&lt;br /&gt;
* The position of the spot and its size are important. We are going to choose a part of the face with strong chromatic noise and use a large “Spot size” for the RT-spot . &lt;br /&gt;
* The choice of the Scope parameter is also important. In this case, where the noise occupies almost the whole color spectrum (red, green, blue, yellow), a high Scope value must be chosen (90 in this case). If on the other hand the image to be processed has mainly luminance noise, then the &amp;quot;usual&amp;quot; Scope value should be chosen, i.e. around 30, to allow the algorithm to differentiate the action according to the colors.&lt;br /&gt;
* There are several differences in the Local Adjustments denoise function compared to the global Noise Reduction module in the Detail tab.&lt;br /&gt;
** You can use a curve to adjust the luminance noise level as a function of the level of detail (from 0 to 6 depending on the position on the abscissa of the curve).&lt;br /&gt;
** A distinction is made depending on the level of detail i.e. if levels 3 and above are greater than 20% of the ordinate of the curve, the luminance noise reduction will be more aggressive. &lt;br /&gt;
** The &amp;quot;white - black&amp;quot; differentiation for luminance is handled by an equalizer, rather than gamma. &lt;br /&gt;
** There is the possibility to distinguish between &amp;quot;Fine chroma&amp;quot; (impulse noise and low chrominance noise for levels 0 to 4) and &amp;quot;Coarse chroma&amp;quot; (packets of noise, blotches for levels 5 and 6) .&lt;br /&gt;
** There is a &amp;quot;red-green/blue -yellow&amp;quot; equalizer which can be useful for low-noise images. &lt;br /&gt;
** There is an extra &amp;quot;Chroma detail recovery&amp;quot; slider using DCT (a Fourier-related discrete cosine transform). &lt;br /&gt;
** There is an added &amp;quot;Luminance &amp;amp; chroma detail threshold (DCT)&amp;quot; slider to differentiate the action based on edges (&amp;quot;Edge detection&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:denoise1.jpg|600px|thumb|center|Denoise settings]]&lt;br /&gt;
&lt;br /&gt;
=====A complex noise reduction problem: how to differentiate between uniform areas and areas with texture or detail?=====&lt;br /&gt;
&lt;br /&gt;
Isolating a subject against a background is a common problem in photography. The subject can be an animal, a plant, a person and the background the sky, grass, a forest, a wall etc. The problem is a complex one for noise reduction software because the algorithm usually &amp;quot;ignores&amp;quot; the difference between the subject and the background. This means that removing noise in the background will cause a loss of detail, contrast and color in the subject. &lt;br /&gt;
&lt;br /&gt;
======An example using Andy Astbury's harvest mouse image======&lt;br /&gt;
&lt;br /&gt;
I chose this image, with the agreement of its author Andy Astbury, because not only is it excellent (the animal stands out very well against a gray background) but it is also slightly noisy. Removing the noise using only the Noise Reduction tool in the Detail tab will inevitably lead to a loss of detail and a reduction in contrast and saturation in the mouse. &lt;br /&gt;
&lt;br /&gt;
Raw file : (Copyright Andy Astbury - Creative Common Attribution-share Alike 4.0) [https://drive.google.com/file/d/1uND8pqgfxxaBhs554RnCvOS5NI3KsWT5/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 file [https://drive.google.com/file/d/1qwslSsbXlM4Ns8A_2t_8_QSMWfsIuAR8/view?usp=sharing]&lt;br /&gt;
The pp3 file is provided as a guide to the tools and possible settings that can be used in cases like this. They are not necessarily the &amp;quot;right&amp;quot; settings. &lt;br /&gt;
&lt;br /&gt;
Traditionally noise is removed in Rawtherapee using the Noise Reduction module (Detail tab).  If we try to remove the luminance and chrominance noise in the background we end up with settings (not shown in the screenshot) in the order of: &lt;br /&gt;
* Luminance slider = 65 &lt;br /&gt;
* Chrominance slider - Master = 20&lt;br /&gt;
Certainly the background will be perfect, but our little harvest mouse will become dull and washed out. So how can we go about denoising this image? &lt;br /&gt;
&lt;br /&gt;
Method outline: &lt;br /&gt;
* We will use a two-step approach. &lt;br /&gt;
**In the first step we will remove the noise in the details that we want to preserve (the harvest mouse) using the Noise Reduction module in the Detail tab, paying particular attention to its eye and tail. Note that in other images this step may also reduce large noise packets. &lt;br /&gt;
** Because the perception of noise is similar to the principles of color appearance models, it will be more visible on a gray background than on a darker background (especially the chrominance noise). The same principle applies for the brighter parts of the image. It is therefore advisable to adjust the tonal contrast in conjunction with noise reduction. This will enhance the image and reduce the perceived noise at the same time.  &lt;br /&gt;
** In the second step, we will treat the noise with some of the tools available in Local Adjustments and in particular, the five tools outlined below:&lt;br /&gt;
*** The mask, which will allow us to differentiate between the detailed parts of the image  (mouse, vegetation) and the background. &lt;br /&gt;
*** The “Denoise hue equalizer” which will allow us to differentiate the denoising between the color of the mouse and the background. &lt;br /&gt;
*** The Scope slider (i.e. use deltaE) which allows us to differentiate the action based on differences in color. &lt;br /&gt;
*** The &amp;quot;Luminance detail recovery (DCT)&amp;quot; slider (abbreviated to “Luma detail recovery” in the current interface) and the “Luminance - Chroma detail theshold” (abbreviated to “Luma-chro detail threshold” in the current interface) slider in Edge Detection, which uses a noise reduction technique (Fourier) based on the difference between the original image and the image that has been denoised using wavelets.&lt;br /&gt;
*** Patch-based denoising (also called non-local means), is another denoising algorithm based on pixel and patch similarity. It allows you to differentiate the denoise between areas with detail and texture (e.g. field mouse, vegetation etc.) and uniform areas (background).&lt;br /&gt;
** Finally we will adjust the saturation, local contrast, etc. &lt;br /&gt;
&lt;br /&gt;
Note that this document is for didactic purposes and the settings are designed to clearly demonstrate the different steps rather than to produce a beautiful image.&lt;br /&gt;
&lt;br /&gt;
======First step: noise reduction and tonal contrast adjustment======&lt;br /&gt;
&lt;br /&gt;
The image below only shows the tone equalizer settings and not the luminance and chrominance denoise settings that were made in the Noise Reduction module (Detail tab). &lt;br /&gt;
Lockable Color Pickers have been placed on the eye, the fur, the vegetation, and the tail. &lt;br /&gt;
* Add a new RT-spot and choose &amp;quot;Full image&amp;quot; in settings. Also in the Settings panel, go to &amp;quot;Mask and merge&amp;quot; and set &amp;quot;Background color/luma mask&amp;quot; to 0 (this will make it easier to distinguish the variations in luminance values). &lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Shadows/Highlights &amp;amp; Tone Equalizer in the drop-down menu. Leave the tool in the default Basic mode.  &lt;br /&gt;
* Position the center of the RT-spot on the gray background. &lt;br /&gt;
* Adjust the equalizer sliders to get the best compromise, while at the same time adjusting the two sliders in the &amp;quot;Noise Reduction&amp;quot; module (Detail tab). Here I used : luminance = 4,  chrominance = 6.5 (Method: Manual &amp;gt; Chrominance-Master).&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_first.jpg|600px|thumb|center|Noise Reduction + Tone Equalizer]]&lt;br /&gt;
&lt;br /&gt;
======Second step: Local Adjustments, Blur/Grain &amp;amp; Denoise module======&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Add tool to current spot&amp;quot; and select Blur/Grain &amp;amp; Denoise and then Denoise. Set the tool to Advanced mode.  &lt;br /&gt;
* Use the &amp;quot;Luminance denoise&amp;quot; curve. &lt;br /&gt;
* For educational purposes and in order to see the effectiveness of the various tools you can set this curve to maximum and activate Aggressive. You will of course have to bring it back to normal values afterwards before continuing.&lt;br /&gt;
&lt;br /&gt;
Familiarize yourself with each of the 5 tools mentioned above, one by one. For example to see the action of the &amp;quot;Denoise hue equalizer&amp;quot;, set Scope to 100, set the slider “Recovery threshold&amp;quot; to 1 in “Recovery based on luminance mask&amp;quot; and leave the 3 other sliders at their default values. &lt;br /&gt;
* Adjust the &amp;quot;Denoise hue equalizer&amp;quot; by increasing the noise level for the background and decreasing it for the mouse. &lt;br /&gt;
* Adjust &amp;quot;Fine chroma&amp;quot; slightly. &lt;br /&gt;
* Review the results.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_levelhue.jpg|600px|thumb|center|Luminance Denoise by levels &amp;amp; Denoise hue equalizer]]&lt;br /&gt;
&lt;br /&gt;
Next: &lt;br /&gt;
* Make a mask (Blur/Grain &amp;amp; Denoise&amp;gt; Denoise &amp;gt; Mask and modifications).&lt;br /&gt;
&lt;br /&gt;
This mask will be used to differentiate the denoise between the background and the rest of the image i.e. the harvest mouse and the vegetation. In this case I used a simple L(L) curve, a gamma adjustment and the contrast curve, but other images may need to use the LC(H) curve, “Structure mask strength”, “Smooth radius”, etc... &lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_mask2.jpg|600px|thumb|center|Mask - contrast curve]]&lt;br /&gt;
&lt;br /&gt;
* Activate the mask.  &lt;br /&gt;
* Expand the &amp;quot;Recovery based on luminance mask&amp;quot; tool.&lt;br /&gt;
* Adjust &amp;quot;Recovery threshold&amp;quot; to reveal detail. Note that this tool is inactive when set to its default value 1.0. As soon as you move the slider, you will see maximum detail and noise which can then be reduced by moving the slider to the right. &lt;br /&gt;
&lt;br /&gt;
For other images it may be necessary to adjust: &lt;br /&gt;
* &amp;quot;Dark area luminance threshold&amp;quot;. The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by the mask). &lt;br /&gt;
* &amp;quot;Light area luminance threshold&amp;quot;, The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by the mask). In this example, the adjustment will allow us to denoise the vegetation as a function of luminance. &lt;br /&gt;
* Decay allows you to manage the progressiveness of any changes. &lt;br /&gt;
* The two &amp;quot;Gray area&amp;quot; sliders allow you to reapply noise reduction if necessary in the &amp;quot;protected&amp;quot; mid-tone area of the mask.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_recovery.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
* Using Scope: here we are on familiar ground. In &amp;quot;Mask and modifications&amp;quot; you can use the two selections &amp;quot;Show modified areas with mask&amp;quot; and &amp;quot;Show modified areas without mask&amp;quot; to see the effect of Scope. Or you can simply adjust Scope and see the effect. In this image, with &amp;quot;Equalizer hue&amp;quot; disabled and &amp;quot;Recovery based on luminance mask&amp;quot; disabled (“Recovery threshold” set to 1) , the Scope action is sensitive between 50 and 100. &lt;br /&gt;
* Use of the two sliders &amp;quot;Luminance detail recovery&amp;quot; (now labeled as “Luma detail recovery”) and &amp;quot;Luminance &amp;amp; chroma detail threshold&amp;quot; (now labeled as “Luma-chro detail threshold”). &lt;br /&gt;
** Gradually increase &amp;quot;Luma detail recovery&amp;quot;. &lt;br /&gt;
** Adjust the &amp;quot;Luma-chro detail threshold&amp;quot;in parallel. You will see the details reappear. &lt;br /&gt;
** 2 algorithms are possible. The first one uses an internal mask and the second one a Laplacian. Each one has its particularities: the Laplacian is more selective, but less progressive.&lt;br /&gt;
&lt;br /&gt;
* Using patch-based denoise (non-local means).&lt;br /&gt;
** What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_nlmeans.jpg|600px|thumb|center|Non-local means]]&lt;br /&gt;
&lt;br /&gt;
To familiarize yourself with this method it is recommended to:&lt;br /&gt;
* Activate &amp;quot;Non-local means only&amp;quot; in Denoise &amp;gt; Mode.&lt;br /&gt;
* Deactivate the mask.&lt;br /&gt;
* Set Scope to 100.&lt;br /&gt;
&lt;br /&gt;
In Advanced mode you have 5 sliders:&lt;br /&gt;
* Strength&lt;br /&gt;
* Detail recovery: allows you to make a preliminary selection between uniform and textured areas. The higher the values, the more the details will be selected.&lt;br /&gt;
* Gamma: allows you to further refine the selection between uniform and textured areas. Lower gamma values will reveal more detail and texture.&lt;br /&gt;
* Maximum patch size: allows you to adapt the size of the &amp;quot;patch&amp;quot; to the size of the objects. In theory, the more noisier the image, the larger this value should be. In practice, you should look for and minimize any artifacts in the transitions between the uniform and textured areas.&lt;br /&gt;
* Maximum radius size: higher values will theoretically give better noise reduction at the expense of increased processing time.&lt;br /&gt;
&lt;br /&gt;
======Final Adjustment - Saturation and Local Contrast======&lt;br /&gt;
&lt;br /&gt;
Add a new RT-spot, centered on the mouse.&lt;br /&gt;
&lt;br /&gt;
Then add 2 tools. &lt;br /&gt;
* “Add tool to current spot” &amp;gt; Vibrance &amp;amp; Warm/Cool &amp;gt; Basic.&lt;br /&gt;
** Move the Vibrance slider until you get the desired increase in saturation.&lt;br /&gt;
* “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets  &amp;gt;Advanced.&lt;br /&gt;
** Use &amp;quot;Contrast by level&amp;quot; in Wavelet pyramid 2 , giving priority to the first levels.&lt;br /&gt;
&lt;br /&gt;
[[File:mulot_wav.jpg|600px|thumb|center|Wavelet]]&lt;br /&gt;
&lt;br /&gt;
======Other methods and tools======&lt;br /&gt;
&lt;br /&gt;
Other methods can be used for the same purpose. &lt;br /&gt;
* Using Local Adjustments &lt;br /&gt;
** &amp;quot;Denoise based on luminance mask&amp;quot;. Uses the same mask as &amp;quot;Recovery based on luminance mask&amp;quot; but increases or decreases the wavelet denoise. It acts prior to denoise (as does the &amp;quot;Denoise hue equalizer&amp;quot;) whereas &amp;quot;Recovery based on luminance mask&amp;quot; acts after denoise by comparing the original noisy image and the denoised image.&lt;br /&gt;
** &amp;quot;Equalizer white-black&amp;quot; and &amp;quot;Equalizer blue-yellow red-green&amp;quot;are the equivalent of the &amp;quot;Luminance curve&amp;quot; in &amp;quot;Noise Reduction&amp;quot; and not very efficient here. &lt;br /&gt;
** Guided Filter in Blur/grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise uses the same mask and the same process as &amp;quot;Recovery based on luminance mask&amp;quot; with negative values of the Detail slider. &lt;br /&gt;
** Excluding spots allow you to restore the image to the settings prior to activating the &amp;quot;Full image&amp;quot; RT-spot.&lt;br /&gt;
** Median in Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise is not very efficient here.&lt;br /&gt;
** &amp;quot;Blur levels&amp;quot; in Local Contrast &amp;amp; Wavelets &amp;gt; Wavelets &amp;gt; Pyramid1: if you want to blur a part of the image according to the level of detail.  &lt;br /&gt;
&lt;br /&gt;
* Other Rawtherapee methods (not developed here) &lt;br /&gt;
** Noise Reduction: the &amp;quot;Luminance control&amp;quot; and chrominance curves allow some form of selection, but they are not sufficient in this particular case. &lt;br /&gt;
** Wavelet levels noise reduction, which includes a &amp;quot;Denoise hue equalizer&amp;quot; and makes use of local contrast.&lt;br /&gt;
&lt;br /&gt;
Comparison of Denoise tools&lt;br /&gt;
[[Comparison of the 3 Rawtherapee noise reduction tools]] &lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
&lt;br /&gt;
Thanks once again to Andy Astbury for this excellent image, which allows us to demonstrate 5 ways of differentiating noise reduction between uniform areas and areas with detail.&lt;br /&gt;
* Denoise hue equalizer &lt;br /&gt;
* Recovery based on luminance mask &lt;br /&gt;
* Scope - deltaE &lt;br /&gt;
* DCT - Edge detection&lt;br /&gt;
* Non-local means&lt;br /&gt;
&lt;br /&gt;
In a difficult image it will probably be necessary to activate all 5 methods to try and find the right balance. The result is a matter of individual taste and is quite subjective.&lt;br /&gt;
 &lt;br /&gt;
It also depends on: &lt;br /&gt;
* The background, which is uniform in this example, but may pose problems if it contains detail or texture. &lt;br /&gt;
* The colors, which are well separated here, but will be more difficult to distinguish if they are &amp;quot;mixed&amp;quot;. &lt;br /&gt;
* DeltaE, which can be affected by chromatic noise, or when the separation of the colors is less distinct.&lt;br /&gt;
* &amp;quot;Edge detection&amp;quot; which will also be affected by high luminance noise.&lt;br /&gt;
&lt;br /&gt;
====A moment of madness - try wavelets!====&lt;br /&gt;
&lt;br /&gt;
=====An example … (don't run away, it isn't as difficult as all that)=====&lt;br /&gt;
&lt;br /&gt;
Original image, with “Exposure compensation” = +1.5&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15.jpg|600px|thumb|center|Amsterdam]]&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====The same image with Wavelet level tone mapping=====&lt;br /&gt;
&lt;br /&gt;
* Leave all settings at their default values. &lt;br /&gt;
* Enable the Local Contrast &amp;amp; Wavelets tool (Advanced mode), select Wavelets in the combobox just under the “Overall strength” slider (the default is Unsharp Mask) and then select Pyramid2.&lt;br /&gt;
* Set Scope (Wavelets) to 80. &lt;br /&gt;
* Use the settings visible on the screenshot. &lt;br /&gt;
* Of course the appearance is subjective so feel free to change the settings.&lt;br /&gt;
* This version of tone mapping is different from the other algorithms implemented in Rawtherapee (Mantiuk for both Tone mapping and Log Encoding and Fattal for Dynamic Range Compression) and is specific to Rawtherapee Wavelets.&lt;br /&gt;
&lt;br /&gt;
[[File:Amsterdam15_wavtm1.jpg|600px|thumb|center|Amsterdam image with wavelet tone mapping]]&lt;br /&gt;
&lt;br /&gt;
====Three ways of increasing texture====&lt;br /&gt;
&lt;br /&gt;
For demonstration purposes we will use: &lt;br /&gt;
* Tone Mapping (Mantiuk)&lt;br /&gt;
* Retinex&lt;br /&gt;
* Wavelets&lt;br /&gt;
&lt;br /&gt;
=====Preparation – original image - Venice=====&lt;br /&gt;
&lt;br /&gt;
[[File:texture-normal1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Sébastien Guyader - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1DASGpHfl_9RDRhbq2_JQVgypgKyrdiBk/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Using Tone Mapping=====&lt;br /&gt;
&lt;br /&gt;
* Create an elliptical RT-spot as shown then “Add tool to current spot” &amp;gt; Tone Mapping. &lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image. &lt;br /&gt;
* Use Advanced mode and adjust &amp;quot;Edge stopping&amp;quot; and Scale.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-tm1.jpg|600px|thumb|center|Tone mapping using the Mantiuk algorithm]]&lt;br /&gt;
&lt;br /&gt;
=====Using Retinex=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Tone Mapping tool and then “Add tool to current spot” &amp;gt; Dehaze &amp;amp; Retinex &amp;gt; Advanced. Then use the settings in the screenshot.&lt;br /&gt;
* Note that the option &amp;quot;Normalize luminance&amp;quot; is checked. This ensures that the average and variance of the luminance values are the same as in the original image.&lt;br /&gt;
* Note also that you can enable the &amp;quot;Use Fast Fourier Transform&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-reti1.jpg|600px|thumb|center|Retinex]]&lt;br /&gt;
&lt;br /&gt;
=====Using Wavelets=====&lt;br /&gt;
&lt;br /&gt;
* Using the same RT-spot as above, turn off the Dehaze &amp;amp; Retinex tool and then “Add tool to current spot” &amp;gt; Local Contrast &amp;amp; Wavelets &amp;gt; Advanced &amp;gt; Wavelets &amp;gt; Pyramid2 and then use the settings in the screenshot.&lt;br /&gt;
* Note the use of &amp;quot;Compression by level&amp;quot;, the values of &amp;quot;Attenuation response&amp;quot;, &amp;quot;Balance threshold&amp;quot; and &amp;quot;Compress residual image&amp;quot;. &lt;br /&gt;
* Try &amp;quot;Contrast by level&amp;quot;. &lt;br /&gt;
* Also try &amp;quot;Directional contrast&amp;quot;, &lt;br /&gt;
* or a combination of these parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:texture-wav1.jpg|600px|thumb|center|Wavelet tone-mapping]]&lt;br /&gt;
&lt;br /&gt;
====Merging layers using blend modes====&lt;br /&gt;
&lt;br /&gt;
You can use &amp;quot;Merge file&amp;quot; in the Color &amp;amp; Light tool (Advanced mode) to simulate the effect of merging layers. Each RT-spot can be thought of as a layer and the &amp;quot;Merge file&amp;quot; function allows you to merge up to 2 RT-spots with the original image.&lt;br /&gt;
* The first &amp;quot;layer&amp;quot; is called Original and corresponds (in the same way as an Excluding spot) to the image data prior to any local adjustments being carried out. &lt;br /&gt;
* When you stack RT-spots on top of each other, for example 6:&lt;br /&gt;
** If the current Spot is number 6, &amp;quot;Merge file&amp;quot; will merge the 6th layer, either with the 5th (Previous Spot), or with the Original Image (the original data), or with a color defined in Background depending on the option chosen in the combobox.&lt;br /&gt;
** If the current spot is number 3 out of the 6, then &amp;quot;Merge file&amp;quot; will merge spot 3 either with the 2nd spot (Previous Spot), or with Original (the original data) or with a color defined in Background.&lt;br /&gt;
** For each of these merges you have 21 blend modes inspired by those of Photoshop© (Normal, Difference, Soft light, Overlay, etc.).&lt;br /&gt;
** For each blend mode you can adjust the opacity, deltaE, and a Contrast Threshold (except in the case of Background).&lt;br /&gt;
** The Graduated Filter (Luminance, Chrominance, Hue), which is located in Color &amp;amp; Light, also works with &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example we will use these features to create a variable blur (of course this isn't the only application).&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Add an RT-spot as in the previous examples and then add the Blur/Grain &amp;amp; Denoise tool in Advanced mode using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Set the RT-spot to Inverse mode (using the checkbox which will appear when you click on the Blur &amp;amp; Noise expander).&lt;br /&gt;
* Choose Scope = 90 or 100 depending on the desired effect.&lt;br /&gt;
* Set Radius to a high value (2000 or more and check the FFTW option), set Blur mode to Luminance &amp;amp; Chrominance (in the combobox at the bottom of the tool panel).            .&lt;br /&gt;
&lt;br /&gt;
[[File:mergeblurinv_2.jpg|600px|thumb|center|Préparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1dJ5yiqF-XdLQdKizCDseUxHf34y4AKZ6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Adding a second RT-spot=====&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;Add tool to current spot&amp;quot; to add the Color &amp;amp; Light tool and set it to Advanced mode.&lt;br /&gt;
* Set &amp;quot;Scope (color tools) &amp;quot; to 100.&lt;br /&gt;
&lt;br /&gt;
[[File:mergetwo1.jpg|600px|thumb|center|Second spot]]&lt;br /&gt;
&lt;br /&gt;
=====First merge in Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Go to the &amp;quot;Merge file&amp;quot; expander in the Color &amp;amp; Light module.&lt;br /&gt;
* In the combobox choose one of the options in the list that starts with None. The options are:&lt;br /&gt;
** Original Image.&lt;br /&gt;
** Previous Spot, which merges with the previous RT-spot (or the Original Image if there is only one RT-spot). &lt;br /&gt;
** Background, which allows you to merge with a colored background.&lt;br /&gt;
&lt;br /&gt;
* Then choose the blend mode (under the heading &amp;quot;Merge with Original/Previous/Background&amp;quot;) and adjust the settings : &amp;quot;Merge background&amp;quot;, Opacity, Contrast Threshold.&lt;br /&gt;
* The other parameters in the Color &amp;amp; Light module can also be used if you wish (e.g. Lightness, Contrast, Saturation etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorignrmal1.jpg|600px|thumb|center|Blend mode &amp;quot;Normal&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using the Soft Light blend mode=====&lt;br /&gt;
&lt;br /&gt;
In the list of merge modes try “Soft Light (legacy)&amp;quot; or a different mode if you wish. &lt;br /&gt;
* Try adjusting the settings (e.g. Opacity, etc.) to see what difference they make. &lt;br /&gt;
* Switch from the Original Image option to Previous Spot and see what difference that makes.&lt;br /&gt;
&lt;br /&gt;
[[File:mergeorigsoftlight1.jpg|600px|thumb|center|Blend mode &amp;quot;Soft Light (legacy)&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
====Using a simple mask to improve color selection====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use an image of the salt mountain in Pammukale (Turkey).&lt;br /&gt;
* It is a difficult image to process, because of the subtle differences in color between the sky and the mountain. Moreover, the mountain contains many irregularities. &lt;br /&gt;
* The preliminary steps are the same as for previous examples. Note the setting of &amp;quot;Scope (color tools)&amp;quot; to 40 which is a compromise but necessary if we are going to process the mountain correctly. &lt;br /&gt;
* For the purposes of this example, we are going to strongly increase the luminance (lightness) and the chrominance of the mountain (this is not an artistic objective) and see if we can avoid affecting the sky in the process. &lt;br /&gt;
* We could have used Excluding spots (or in a future GUI release, a polygon), but for now, we are going to use a simple mask. We could also have used several curves for the mask, or created several masks by duplicating the RT-spot. &lt;br /&gt;
* 2 types of mask are available in Local Adjustments. &lt;br /&gt;
** 1) Those that don't add or subtract the mask from the image. The aim in this case is to improve the quality of the deltaE selection. &lt;br /&gt;
** 2) Those that make use of the resulting differences when they are added to, or subtracted from the image.&lt;br /&gt;
** We are going to use the first case (selection improvement).&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1azCxu1midw6dcuN7SbvbAiJH4pxX5BTA/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Strongly increase Lightness and Chrominance=====&lt;br /&gt;
&lt;br /&gt;
* Observe the result: there is color bleed and the sky has been affected by the changes, which is what we wanted to avoid.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimplelum250chro1401.jpg|600px|thumb|center|Increasing the lightness and chrominance]]&lt;br /&gt;
&lt;br /&gt;
=====Creating a simple mask=====&lt;br /&gt;
&lt;br /&gt;
* We are going to use only one of the 3 LCH curves (in this case L). &lt;br /&gt;
* Examine the L(L) curve closely. You will see that the point of inflection is located at the transition between the gray areas. This &amp;quot;transition&amp;quot; corresponds to the 3 references of the RT-spot (chroma, luma, hue) and is common to all the curves -- C(C), L(L), LC(H).&lt;br /&gt;
* Avoid using Blend to ensure that only the shape detection is improved. &lt;br /&gt;
* You can also use &amp;quot;Show modifications with mask&amp;quot; in &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:masksimpleshow1.jpg|600px|thumb|center|Show the mask]]&lt;br /&gt;
&lt;br /&gt;
=====Fine tuning the result=====&lt;br /&gt;
&lt;br /&gt;
* Set &amp;quot;Mask and modifications&amp;quot; to &amp;quot;Show modified image&amp;quot;.&lt;br /&gt;
* Activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* If necessary, adjust the &amp;quot;Smooth radius&amp;quot; mask tool. &lt;br /&gt;
* Retouch the &amp;quot;Contrast curve&amp;quot; mask and L(L) curves if necessary. &lt;br /&gt;
* Switch to Advanced mode and try the Gamma, Slope, and Laplacian threshold masks (instead of the &amp;quot;Smooth radius&amp;quot; mask). &lt;br /&gt;
* Certainly it is not perfect, but it is much better -- the goal is to discover how the masks work.&lt;br /&gt;
&lt;br /&gt;
To improve the mask performance, you have 2 solutions: &lt;br /&gt;
* Duplicate the RT-spot: if you duplicate the RT-spot, and place it alongside the previous one, the slight change in the position of the center (references), will allow the second mask to &amp;quot;correct&amp;quot; the &amp;quot;anomalies or incompleteness&amp;quot; of the previous mask. Moreover this option allows you to readjust certain parameters if necessary in the second spot (in this case Lightness &amp;amp; Chrominance) to give a more homogeneous result. &lt;br /&gt;
* Use the mask of another open tool (if of course the tool is equipped with a mask). In this case you keep the same references (luma, chroma, hue) to create the masks and to take into account the deltaE (Scope).&lt;br /&gt;
&lt;br /&gt;
DeltaE considerations: &lt;br /&gt;
* You can disable the core function of Local Adjustments i.e. the Scope function, which takes into account deltaE, if you want to work entirely with masks and ignore Scope. In this case set Scope=100. You can see that the Scope function has been disabled and you will be able to use just the Blend function to combine the mask and the image.&lt;br /&gt;
* When you use the Mask Tools sliders available in &amp;quot;Mask &amp;amp; modifications&amp;quot; (Contrast curve mask, chroma mask, gamma mask, etc.), you must remember that they are sensitive to the specific deltaE settings for the mask i.e. &amp;quot;deltaE Image mask&amp;quot; in the Mask &amp;amp; Merge panel in Settings.&lt;br /&gt;
&lt;br /&gt;
[[File:masksimple1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Improved result with &amp;quot;Recovery based on luminance mask&amp;quot;=====&lt;br /&gt;
&lt;br /&gt;
Normally we use masks in RawTherapee to: &lt;br /&gt;
* Improve detection (without blend).&lt;br /&gt;
* Improve detection and add or subtract the mask to or from the image (with blend).&lt;br /&gt;
In this example we will use the light and dark areas of the mask to select the parts of the image that will be modified by the Color &amp;amp; Light settings and then combine them with the unmodified image as follows: &lt;br /&gt;
* The dark and black areas of the mask will remain as close as possible to the original image. &lt;br /&gt;
* The very bright or white areas of the mask will also remain as close as possible to the original image. &lt;br /&gt;
* The intermediate zone will correspond to the settings in the Color &amp;amp; Light tool.&lt;br /&gt;
&lt;br /&gt;
The area between the dark and light areas can be adjusted with the &amp;quot;Recovery based on luminance mask&amp;quot; slider. &lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
* To ensure that the  L*a*b* values of the Lockable Color Pickers correspond to the real values you need to set : Local Adjustments &amp;gt; Settings &amp;gt; Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 (slider labeled as “Background color for luminance and color masks” in screenshot). &lt;br /&gt;
&lt;br /&gt;
Image with Color &amp;amp; Light settings - without mask &lt;br /&gt;
&lt;br /&gt;
File pp3; [https://drive.google.com/file/d/1BWpBUd5qjpDHv_stdF5ord8qFGhxC0J0/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recov0.jpg|600px|thumb|center|Color and Light]]&lt;br /&gt;
&lt;br /&gt;
======Mask======&lt;br /&gt;
&lt;br /&gt;
Note the use of Blur Mask with &amp;quot;Contrast threshold&amp;quot; and Radius. This increases the gray value on the right-hand part of the salt mountain and reduces the effect of the Color &amp;amp; Light adjustments. &lt;br /&gt;
 &lt;br /&gt;
[[File:mask_recov.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
======Recovery of the original image characteristics======&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled in &amp;quot;Mask and modifications&amp;quot; and that the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the &amp;quot;Recovery based on luminance mask&amp;quot; expander. &lt;br /&gt;
* Set the &amp;quot;Recovery threshold&amp;quot;: the closer the slider is to the value &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and brought back to the original image values. &lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values are the two limits below and above which the effect of the mask will be progressively taken into account (in this case the dark-area threshold = 32.1 and the light-area threshold = 85). &lt;br /&gt;
&lt;br /&gt;
* If necessary, use “Decay strength&amp;quot; to adjust the rate of the decay. &lt;br /&gt;
* Try disabling the mask in &amp;quot;Mask and modifications&amp;quot; (&amp;quot;Enable mask&amp;quot; box unchecked) to see the effect. &lt;br /&gt;
* With the mask enabled (&amp;quot;Enable mask&amp;quot; box checked) try to reset the &amp;quot;Recovery threshold&amp;quot; slider to 1 in &amp;quot;Mask and modifications&amp;quot;. &lt;br /&gt;
* Try varying other mask settings as well as the four &amp;quot;recovery&amp;quot;settings.&lt;br /&gt;
&lt;br /&gt;
[[File:mask_recovend.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====What can you do when the mask has a salt-and-pepper appearance? (under development)====&lt;br /&gt;
When you use the LC(h) curve to create a mask, the image of the mask can sometimes be covered with black and white dots (salt and pepper noise) that prevent the mask from functioning correctly. The image used in the above example does not demonstrate this effect very well because it is not very noisy, so I have chosen a different image with significant chromatic noise. &lt;br /&gt;
[[File:masknoisechroma.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Recovery=====&lt;br /&gt;
Processing steps:&lt;br /&gt;
In Settings &amp;gt; &amp;quot;Show additional settings&amp;quot; &amp;gt; &amp;quot;Mask and Merge&amp;quot;, there is a slider labeled &amp;quot;Denoise chroma mask&amp;quot;. &lt;br /&gt;
Adjust the slider until you get the desired effect&lt;br /&gt;
[[File:masknoisechromaden.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
=====Chroma noise can also have other effects on a mask.=====&lt;br /&gt;
For example, if you use the C curve to create a mask, artifacts (clumps of grayish spots) may appear when the mask is merged with the original image. It is likely that this is also due to chromatic noise, in which case you can use the above procedure to correct the problem.&lt;br /&gt;
&lt;br /&gt;
====Blending a mask with the original image====&lt;br /&gt;
&lt;br /&gt;
In this example, we want to increase the impression of perspective (relief) of the Pagodas. &lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
* We could have used specific tools here to give a heightened impression of relief e.g. CBDL (Contrast by Detail Levels) or a Wavelet pyramid. &lt;br /&gt;
* But for the purposes of this demonstration, we will use a mask with &amp;quot;blend&amp;quot;.&lt;br /&gt;
* The preparation is identical to previous examples with &amp;quot;Scope (color tools)&amp;quot; set to 40 (arbitrary), and Color &amp;amp; Light in &amp;quot;Advanced&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1GdqejdnbW1kJFNY6y9sdQDlF2rCEGMCu/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Mask settings: what not to do=====&lt;br /&gt;
&lt;br /&gt;
* For the purpose of this demonstration we will use 2 features.&lt;br /&gt;
** The LC(H) curve to select the colors. &lt;br /&gt;
** A Blur Mask which combines a contrast threshold and a blur function.&lt;br /&gt;
* Note the checkbox FFTW, which although it consumes resources, increases the quality of the results. Without FFTW the radius is limited to 100 whereas with FFTW it is increased to 1000.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblendshow2.jpg|600px|thumb|center|The mask]]&lt;br /&gt;
&lt;br /&gt;
======Results======&lt;br /&gt;
&lt;br /&gt;
* Once again, activate &amp;quot;Enable mask&amp;quot;. &lt;br /&gt;
* Set the value of Blend to whatever you like. &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot; mask if necessary. &lt;br /&gt;
* If you have enabled the non-mask settings of Color &amp;amp; light (lightness, contrast, etc.), the &amp;quot;Spot structure&amp;quot; slider will have an effect. &lt;br /&gt;
* You can see that the image now has a dominant color. This is caused by using the Blend function with the LC(H) curve. &lt;br /&gt;
** Switch the curve to Linear mode and you will see that the dominant color disappears.&lt;br /&gt;
** To overcome this problem avoid combining several mask settings, irrespective of whether they use Blend or not. &lt;br /&gt;
** If you need to combine these settings, it is advisable, as in the simple mask case above, to create either a second (or several) RT-spot(s) using the Duplicate function and setting one to Blend and the other without (or with different Blend values). You can also use another mask associated with another tool.&lt;br /&gt;
&lt;br /&gt;
=====The right approach=====&lt;br /&gt;
&lt;br /&gt;
As seen above, we need to take a two-step approach, for example by creating 2 spots.&lt;br /&gt;
* The first one to take into account the LC(H) curve.&lt;br /&gt;
* The second to act on the structure.&lt;br /&gt;
&lt;br /&gt;
======Working on the structure======&lt;br /&gt;
&lt;br /&gt;
There are several mask-type tools (in Advanced mode) that allow you to modify the structure:&lt;br /&gt;
* Blur Mask which includes a contrast threshold and a blur function.&lt;br /&gt;
* Structure Mask which acts directly on the structure.&lt;br /&gt;
* When using these two tools, make sure that the LC(H) curve has not been activated (i.e. no curve).&lt;br /&gt;
* However if you wish to use the LC(H) curve, you can associate the L(L) curve with it.&lt;br /&gt;
* The Blur Mask and Structure Mask tools can also be associated with each other.&lt;br /&gt;
* &amp;quot;Local contrast” (by wavelet level) and &amp;quot;Wavelet level selection&amp;quot;, can be associated with the L(L) mask curve and generate a local-contrast effect.&lt;br /&gt;
&lt;br /&gt;
Reminder:&lt;br /&gt;
* Activate “Enable mask”.&lt;br /&gt;
* Set Blend to whatever value you like.&lt;br /&gt;
* Adjust &amp;quot;Smooth radius&amp;quot; mask if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:maskblend2.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
====How to use the Common Color Mask and an example of how to blend 2 RT-spots====&lt;br /&gt;
&lt;br /&gt;
This mask does not work in exactly the same way the other Local Adjustments masks. It does not allow you to modify the behaviour of an existing tool like the mask in Color &amp;amp; light for example, but is a tool in its own right. You can use it to change the appearance of an image e.g. contrast, luminance, color, as well as its texture. &lt;br /&gt;
* It consists of the 3 curves C(C), L(L), LC(H), (or in Advanced mode, 3 curves plus Structure Mask &amp;amp; Blur Mask), which will generate differences in the color or structure of the image when compared to the original image.&lt;br /&gt;
* These &amp;quot;differences&amp;quot; are similar to the differences generated by the Lightness, or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
* The color differences between the mask image and the original image are taken into account by the deltaE (ΔE) and transition parameters.&lt;br /&gt;
* Of course you can also use it in conjunction with other tools in the same RT-spot.&lt;br /&gt;
* The simple example that follows allows you to understand how it works. It is based on the same ΔE principles as the other tools in Local Adjustments.&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
Repeat the preliminary steps outlined in previous examples and add the tool to the RT-spot.&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Common Color Mask &amp;gt; Standard. For the purposes of the demonstration, do not open any other tools. &lt;br /&gt;
* To create the mask, we will simplify the exercise as much as possible by using only 2 curves C(C) and L(L) to take into account the references of the RT-spot. &lt;br /&gt;
* Note that the 2 sliders &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask&amp;quot; are not set to zero, so that the user is not confused by a lack of response from the system; the two values -10 are arbitrary and low.&lt;br /&gt;
&lt;br /&gt;
[[File:common-maskprepa1.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Creative Common Attribution-share Alike 4.0):[https://drive.google.com/file/d/1aWvYbW-rDPQaLWoRzbK5HAcz9dU0GHFU/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Luminance Mask=====&lt;br /&gt;
&lt;br /&gt;
The curve makes a small change to the luminance. &lt;br /&gt;
* Note the position of the top of the curve on the gray transition. This means that the Luminance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-showL1.jpg|600px|thumb|center|Luminance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Chrominance Mask=====&lt;br /&gt;
&lt;br /&gt;
* Notice the position of the top of the curve on the gray transition. This means that the Chrominance mask matches the reference value of the RT-spot.&lt;br /&gt;
&lt;br /&gt;
[[File:Common-mask-showC11.jpg|600px|thumb|center|Chrominance mask]]&lt;br /&gt;
&lt;br /&gt;
=====Preview ΔE=====&lt;br /&gt;
&lt;br /&gt;
From here you can play with the deltaE (ΔE) between &amp;quot;Image + Mask&amp;quot; and Original Image.&lt;br /&gt;
* Try increasing or decreasing the Scope (make sure you use the Common Color Mask slider and not the slider in the Settings module above). &lt;br /&gt;
* Try adjusting the parameters in the Settings &amp;quot;Shape detection&amp;quot; panel: &amp;quot;Threshold ΔE-scope&amp;quot;, &amp;quot;ΔE decay&amp;quot;, &amp;quot;ab-L balance (ΔE)&amp;quot;, &amp;quot;C-H balance (ΔE)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-previewdE11.jpg|600px|thumb|center|Preview deltaE - ΔE]]&lt;br /&gt;
&lt;br /&gt;
=====Show modifications=====&lt;br /&gt;
Go to &amp;quot;Show modifications with mask&amp;quot;.&lt;br /&gt;
* Adjust &amp;quot;Add/subtract luminance mask &amp;quot; and &amp;quot;Add/subtract chrominance mask &amp;quot; (these sliders could also have been called &amp;quot;opacity&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask-modif11.jpg|600px|thumb|center|Show modifications]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
You can: &lt;br /&gt;
* Change the Scope (the Common Color Mask slider which acts on ΔE). &lt;br /&gt;
* Activate the &amp;quot;Smooth radius&amp;quot; mask, which will try to reduce the artifacts caused by the fact that the mask has been generated by 3 different curves - C(C), L(L), LC(H). &lt;br /&gt;
* Change the Chroma mask. &lt;br /&gt;
* Adjust the &amp;quot;Contrast curve&amp;quot; mask.&lt;br /&gt;
* Try &amp;quot;Scope (ΔE image mask)&amp;quot; in Settings: this slider acts on the mask and takes into account the deltaE of the mask compared to the center of the RT-spot. It is different from Scope (the first slider of the Common Color Mask), which acts on the difference between the original image and the mask you have created.&lt;br /&gt;
&lt;br /&gt;
Switch to Advanced mode. &lt;br /&gt;
* Adjust the Soft Radius slider which will reduce any artifacts arising from differences between the original image and the one obtained after &amp;quot;adding&amp;quot; the mask. The default value is 1 even in Standard mode and produces a small variation - even without the mask – which can be seen in &amp;quot;Show modifications&amp;quot;. &lt;br /&gt;
* Try the &amp;quot;Laplacian threshold&amp;quot; mask, and note the difference compared to the &amp;quot;Smooth radius&amp;quot; mask. &lt;br /&gt;
* Try the Gamma and Slope masks. &lt;br /&gt;
* Try to change the structure with one of the tools provided: Structure Mask, Blur Mask, &amp;quot;Local contrast” (by wavelet level) mask. &lt;br /&gt;
* Try the Graduated Filter Mask.&lt;br /&gt;
&lt;br /&gt;
[[File:common-mask11.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
Now we are going to enhance the Common Color Mask image with the &amp;quot;Merge file&amp;quot; tool in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
=====Adding a new RT-spot Color &amp;amp; Light - Advanced mode=====&lt;br /&gt;
&lt;br /&gt;
For demonstration (and not artistic) purposes, we will use 3 of the 21 possible blend modes. &lt;br /&gt;
* Add a new RT-spot. &lt;br /&gt;
* Add a Color &amp;amp; Light tool in Advanced mode.&lt;br /&gt;
* Set the &amp;quot;Scope (color tools)&amp;quot; correctly (using Preview ΔE). &lt;br /&gt;
* Choose 3 settings to increase the luminance, contrast and chrominance&lt;br /&gt;
&lt;br /&gt;
[[File:common-color1.jpg|600px|thumb|center|Adding an RT-spot]]&lt;br /&gt;
&lt;br /&gt;
=====Preparing the &amp;quot;merge&amp;quot; =====&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Previous spot&amp;quot;. We are now going to merge the new RT-spot (Color &amp;amp; Light) with the previous one (Common Color Mask).&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-prepa1.jpg|600px|thumb|center|Preparing the merge]]&lt;br /&gt;
&lt;br /&gt;
=====First merge using Normal blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Choose the Normal blend mode.&lt;br /&gt;
* We arbitrarily choose 3 settings: “Merge background” = 54.2 (takes into account the deltaE between the 2 layers), Opacity = 54.2 (about 50% for each), Contrast Threshold = 12.5 (takes into account the differences between uniform and textured areas).&lt;br /&gt;
* The two identical values of 54.2 are arbitrary and you can choose other values 43, 68, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-normal1.jpg|600px|thumb|center|Merge with Normal blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Second merge using &amp;quot;Soft Light (legacy)&amp;quot; blend mode=====&lt;br /&gt;
&lt;br /&gt;
* Change the blend mode and choose &amp;quot;Soft Light (legacy)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-softphot1.jpg|600px|thumb|center|Merge using Soft Light (legacy)]]&lt;br /&gt;
&lt;br /&gt;
=====Third merge using Color Burn blend mode=====&lt;br /&gt;
* Change the blend mode and choose Color Burn (the choice is completely arbitrary). &lt;br /&gt;
* Note the differences in luminance and chrominance.&lt;br /&gt;
&lt;br /&gt;
[[File:common-color-colburn1.jpg|600px|thumb|center|Merge using &amp;quot;Color Burn&amp;quot; blend mode]]&lt;br /&gt;
&lt;br /&gt;
=====Additional information=====&lt;br /&gt;
&lt;br /&gt;
Of course, you can create as many Common Color Masks as you want. Simply duplicate the mask and place it close to the previous one and use similar settings. &lt;br /&gt;
&lt;br /&gt;
Some important points about the mask curves C(C), L(L), LC(H). &lt;br /&gt;
&lt;br /&gt;
* These curves are used to create the mask. &lt;br /&gt;
* For each of the curves, the vertical dark-gray/light-gray separation line represents the 3 references of the RT-spot: luminance, chroma and hue. &lt;br /&gt;
* For the first curve shown below (with the highest point of the curve on the selection – L in this case), the deltaE selection is improved.&lt;br /&gt;
* For the second curve shown below, the hue used by the mask corresponds to the hue reference of the RT-spot (the peak of the curve is on the selection – H in this case). Pulling the curve downwards will progressively mask (or reduce the impact) of whatever adjustment has been applied to the selected hue (or L, or C depending on which of the curves you are using). &lt;br /&gt;
* For the third curve shown below, the hue selection for the mask does not match the hue reference of the RT-spot. In this case, pulling the curve downwards will progressively mask whatever adjustment (luminance and chrominance) has been applied to that particular color.&lt;br /&gt;
&lt;br /&gt;
Note that the effect of the combined LC (H) curve can be visualised by referring to the spatial representation of the Lch coordinates i.e. as you move up and down the vertical L axis, there will be a corresponding increase or decrease in the chroma values. &lt;br /&gt;
&lt;br /&gt;
[[File:mask-curve.jpg|600px|thumb|center|Mask selection]]&lt;br /&gt;
&lt;br /&gt;
* For this demonstration we used an image with two dominant colors: magenta (flower) and green (foliage). Images that have more varied color, luminance and chrominance (e.g. sky, sea, mountains, houses, fields, flowers, portraits etc.) would require more elaborate masks. &lt;br /&gt;
* We stay with the &amp;quot;philosophy&amp;quot; of Local Adjustments, by only relying on the references of the RT-spot. We could of course have used just the curves outlined above but this would have given a completely different result.&lt;br /&gt;
* Similarly, for the merge we chose the same color range as for the mask. We could have made another choice for the second RT-spot, by positioning it on the foliage but the result of the merge would have been different, with less variation in the flowers.&lt;br /&gt;
&lt;br /&gt;
====Correcting an underexposed portrait and improving grainy skin (Mairi)====&lt;br /&gt;
&lt;br /&gt;
The portrait of Mairi gives us the opportunity to use several local-adjustment tools. We are going to:&lt;br /&gt;
* Increase the Exposure of the image to make it lighter. &lt;br /&gt;
* Use CBDL to soften the skin and Clarity to lighten the face.&lt;br /&gt;
* Make a Graduated Filter to open up the shadows of the face on the right-hand side of the image. &lt;br /&gt;
* Use 3 Excluding spots to &amp;quot;exclude&amp;quot; the eyes and lips from the adjustments.&lt;br /&gt;
* Use an LC(H) mask to &amp;quot;exclude&amp;quot; the hair from the softening adjustments (to avoid losing definition). &lt;br /&gt;
* Compare the result &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot;. &lt;br /&gt;
* Remark: the settings have been given as an indication and are a matter of individual taste.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright Pat David - Creative Common Attribution-share Alike 4.0):  [https://drive.google.com/file/d/1m4UBhES2AVe_sJNqMVSz5jA-Qg-s7LHt/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Increasing exposure=====&lt;br /&gt;
&lt;br /&gt;
* Exposure + 0.5&lt;br /&gt;
* Note: we could have used an RT-spot to limit the exposure increase to a particular area instead of applying an overall increase in exposure.&lt;br /&gt;
&lt;br /&gt;
[[File:mairiexp05.jpg|600px|thumb|center|Exposure increase]]&lt;br /&gt;
&lt;br /&gt;
=====Using CBDL=====&lt;br /&gt;
&lt;br /&gt;
* Create an RT-spot with a large &amp;quot;Spot size&amp;quot; = 47&lt;br /&gt;
* Make a gradual contrast reduction for levels 0 to 4&lt;br /&gt;
* Set Clarity to 60&lt;br /&gt;
* Set Scope to 40&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-cbdl_1.jpg|600px|thumb|center|CBDL]]&lt;br /&gt;
&lt;br /&gt;
=====Graduated Filter=====&lt;br /&gt;
&lt;br /&gt;
* Create another Color &amp;amp; Light RT-spot. &lt;br /&gt;
* Graduated Filter settings: Luminance = -0.6; “Gradient angle” = 71.5&lt;br /&gt;
* You can also play with the chrominance settings (Advanced mode).&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-grad1.jpg|600px|thumb|center|Graduated Filter]]&lt;br /&gt;
&lt;br /&gt;
=====Excluding the eyes and lips=====&lt;br /&gt;
&lt;br /&gt;
* Create 3 Excluding RT-spots on the eyes and lips.&lt;br /&gt;
* Adjust the Scope (excluding) to obtain the desired result.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-excluding1.jpg|600px|thumb|center|Excluding]]&lt;br /&gt;
&lt;br /&gt;
=====Hair exclusion mask=====&lt;br /&gt;
&lt;br /&gt;
* Go back to the first RT-spot. &lt;br /&gt;
* Go to &amp;quot;Mask and modifications&amp;quot;.&lt;br /&gt;
* Select &amp;quot;Show mask&amp;quot;.&lt;br /&gt;
* Open the LC(H) curve.&lt;br /&gt;
* Identify the color of the skin (the boundary between the light and dark gray areas on the graph).&lt;br /&gt;
* Lower the curve as shown in the graph (or similar). &lt;br /&gt;
* Adjust the &amp;quot;Smooth radius&amp;quot;  mask.&lt;br /&gt;
* Adjust the Gamma, Slope, Contrast-curve masks if necessary.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-mask_1.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
=====Result=====&lt;br /&gt;
&lt;br /&gt;
* Set the mask to &amp;quot;Show image with modifications&amp;quot;.&lt;br /&gt;
* Check the &amp;quot;Enable mask&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-fin1.jpg|600px|thumb|center|Result]]&lt;br /&gt;
&lt;br /&gt;
=====Before and After Comparison=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-befaft1.jpg|600px|thumb|center|Before &amp;amp; After]]&lt;br /&gt;
&lt;br /&gt;
=====An alternative - replace CBDL with Wavelets “Contrast by level&amp;quot;.=====&lt;br /&gt;
&lt;br /&gt;
* The Wavelets module is more powerful than CBDL (Contrast By Detail Levels) and may seem more complex given the number of options. &lt;br /&gt;
* However, it allows you to target the CBDL effect by using the &amp;quot;Attenuation Response&amp;quot; (Damper) and Offset sliders. This means that instead of applying the changes linearly to the wavelet decomposition signal, they will be adjusted depending on the actual value of the signal to avoid amplifying defects such as noise. &lt;br /&gt;
* The wavelet option also has a Clarity function.&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wav_1.jpg|600px|thumb|center|Wavelet contrast by level and Clarity]]&lt;br /&gt;
&lt;br /&gt;
=====Using a mask with wavelets (yes it is possible!)=====&lt;br /&gt;
&lt;br /&gt;
[[File:mairi-wavmask1.jpg|600px|thumb|center|Wavelet mask]]&lt;br /&gt;
&lt;br /&gt;
====Add a border to an image====&lt;br /&gt;
=====General=====&lt;br /&gt;
Local Adjustments can be used to add a white, black, gray or colored border to an image.&lt;br /&gt;
&lt;br /&gt;
The corresponding .pp3 presets can be downloaded from the following links:&lt;br /&gt;
White border [https://drive.google.com/file/d/1fDIQl7Vp82SA4iY4TwwDazFpu97en0Fz/view?usp=sharing]&lt;br /&gt;
Gray border [https://drive.google.com/file/d/1mXM1zRaA8w8yai7UGgkae_lg7VggjmCK/view?usp=sharing]&lt;br /&gt;
Colored border [https://drive.google.com/file/d/1Ztj8y1XFwlJ7fH0WXco8WRRKa6G4BzQm/view?usp=sharing]&lt;br /&gt;
Black border [https://drive.google.com/file/d/1KND7KTPfHybarkcUiSibtJ3FqISRUl9q/view?usp=sharing] &lt;br /&gt;
&lt;br /&gt;
The borders are added inside the existing image area, unlike other programs, which usually increase the image size by adding the border outside the image area.&lt;br /&gt;
&lt;br /&gt;
You can customize the border presets by changing the width (vertical or horizontal borders) or the color. You can also use &amp;quot;partial paste&amp;quot; to apply any modifications to the presets to other images.&lt;br /&gt;
&lt;br /&gt;
I want to thank Arturo Isilvia (@aruroisilvia)  for his contribution to these presets.&lt;br /&gt;
&lt;br /&gt;
=====Two RT-spots=====&lt;br /&gt;
These presets are based on two RT-spots:&lt;br /&gt;
* The first spot uses full-image mode and the Color &amp;amp; Light tool in Advanced mode to make the image background either black, white, gray or colored.&lt;br /&gt;
*** For black, white or gray borders, the RGB Tone Curve in the Color &amp;amp; Light tool is used.&lt;br /&gt;
*** For colored borders, the &amp;quot;Color correction grid&amp;quot; is used. &lt;br /&gt;
* The second spot is a rectangle used in Excluding mode to define the border boundaries.&lt;br /&gt;
&lt;br /&gt;
=====First RT-spot=====&lt;br /&gt;
======First RT-spot settings for black, gray and white borders======&lt;br /&gt;
[[File:Borderrgb.jpg|600px|thumb|center|Uses the RGB Tone Curves]]&lt;br /&gt;
* The Color and Light tool is set to Advanced mode.&lt;br /&gt;
* The changes are made using the RGB Tone Curve tool. The setting corresponds to the above example (gray border). &lt;br /&gt;
* Set Transition to 100 in the Settings module.&lt;br /&gt;
&lt;br /&gt;
======First RT-spot settings for colored borders======&lt;br /&gt;
[[File:Bordergrid.jpg|600px|thumb|center|Use the “Color correction grid”]]&lt;br /&gt;
* Lightness, Contrast, Chrominance are set to -100; Gamma to 0.5&lt;br /&gt;
* Choose the color of your choice in the &amp;quot;Color correction grid&amp;quot;. In the example, the basic setting is green.&lt;br /&gt;
* In Settings, set: Transition = 100, Scope = 100, “DeltaE scope threshold” = 10.&lt;br /&gt;
&lt;br /&gt;
=====Second RT-spot=====&lt;br /&gt;
[[File:Borderexcluding.jpg|600px|thumb|center|Settings for the 2nd “excluding” RT-spot - ]]&lt;br /&gt;
Note the following:&lt;br /&gt;
* Scope = 100, Transition = 100, DeltaE scope threshold = 10&lt;br /&gt;
* The “Shape method” is set to &amp;quot;Symmetrical (mouse + sliders)&amp;quot; (in “Show additional settings” &amp;gt; “Specific cases” &amp;gt; “Shape method”). You can easily change the values of Right and Bottom to adjust the width of the border:&lt;br /&gt;
** &amp;quot;Right&amp;quot; changes the vertical part.&lt;br /&gt;
** &amp;quot;Bottom&amp;quot; changes the horizontal part.&lt;br /&gt;
&lt;br /&gt;
==HDR to SDR: A First Approach (Log Encoding - CAM16 - JzCzHz - Sigmoid)==&lt;br /&gt;
High dynamic range images are one of the recurring problems in image processing. There are already several algorithms in RawTherapee that can be used to reduce the dynamic range, with more or less success:&lt;br /&gt;
* Dynamic Range Compression and Shadows/Highlights in the Exposure tab.&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure, Tone Equalizer, Tone Response Curve, Wavelets, etc., in the Local Adjustments tab.&lt;br /&gt;
To address some of the limitations of these algorithms, two additional modules have been added to the Local Adjustments tab to help with the processing of HDR images:&lt;br /&gt;
* Log Encoding&lt;br /&gt;
* Color Appearance (CAM &amp;amp; JzCzHz)&lt;br /&gt;
The Color Appearance module is a simplified version of the Color Appearance &amp;amp; Lighting (Ciecam02/16) module found in the Advanced tab of the main menu. It uses the same CAM16 and HDR functions adapted to the specific requirements of Local Adjustments. It can take into account HDR Peak Luminance and also includes an experimental JzCzHz function (in Advanced mode) to improve HDR processing.&lt;br /&gt;
 &lt;br /&gt;
Please note that some parts the following explanations may be controversial, especially for JzCzHz and part of Cam16 because: &lt;br /&gt;
* There is a lack of documentation for JzCzHz. &lt;br /&gt;
* The basic JzCzHz algorithm as published by the researchers does not function correctly (saturation defects, poor behavior with deep shadows, etc.). &lt;br /&gt;
* The solutions to these problems are my personal interpretation of how the algorithm should behave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
The code used in this part of RawTherapee is similar to:&lt;br /&gt;
&lt;br /&gt;
* The Log Tone Mapping module in ART, designed by Alberto Griggio. &lt;br /&gt;
* The Filmic module in darktable, designed by Aurélien Pierre.&lt;br /&gt;
&lt;br /&gt;
Both are inspired by the work on logarithmic coding developed by the Academy Color Encoding System (ACES).&lt;br /&gt;
&lt;br /&gt;
====The algorithm is based on a 3-step process:====&lt;br /&gt;
* The first step for a given image (HDR or otherwise) involves calculating the deviation from the theoretical mean gray value (18% gray) of the darkest blacks and the brightest whites. This is expressed in photographic Ev units (luminosity index, which is related to the brightness of the scene). The black and white Ev values, along with the average or mean luminance of the scene (Yb%) are used by the algorithm (either automatically or with manual override) to modify the balance of the RGB values, thereby reducing contrasts, enhancing shadows and reducing highlights, without overly distorting the image rendering.&lt;br /&gt;
&lt;br /&gt;
* In the second and third steps, the data is manually corrected by the user to increase local contrast (which has been reduced by the &amp;quot;Log&amp;quot; conversion) and adjust the viewing conditions for the intended output device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Chromatic Adaptation Example====&lt;br /&gt;
&lt;br /&gt;
The first step is to find an almost mathematically perfect white balance using White Balance &amp;gt; Auto &amp;gt; “Temperature correlation” (same example and settings as in the “Ciecam Advanced tab” tutorial). &lt;br /&gt;
&lt;br /&gt;
Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1CiQ2t4KyD3tdCiNNhskqUG2cH9LT2ly7/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
[[File:catATwb.jpg|600px|thumb|center|White Balance - Temperature correlation]]&lt;br /&gt;
&lt;br /&gt;
=====Choose a suitable Local Adjustments setting - Preparation =====&lt;br /&gt;
&lt;br /&gt;
* Select the Local Adjustments tab.&lt;br /&gt;
* Add a “Full image” spot.&lt;br /&gt;
* Set some lockable color pickers as shown.&lt;br /&gt;
&lt;br /&gt;
[[File:catLAset.jpg|600px|thumb|center| Chromatic Adaptation - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Select Log Encoding=====&lt;br /&gt;
&lt;br /&gt;
Choose: &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
[[File:catLAlog.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Try changing the position of the center of the RT-spot.&lt;br /&gt;
* Try changing the values of Scope e.g. 40 - 60 - 80 – 100.&lt;br /&gt;
* Observe the results.&lt;br /&gt;
* Note that the image still has a yellow cast.&lt;br /&gt;
&lt;br /&gt;
=====Modify Chromatic adaptation - cat02=====&lt;br /&gt;
&lt;br /&gt;
[[File:catLAlogadap.jpg|600px|thumb|center| Chromatic Adaptation - Log encoding - Cat02]]&lt;br /&gt;
&lt;br /&gt;
* Make the image cooler by moving the “Chromatic adaptation cat02&amp;quot; slider to the left.&lt;br /&gt;
* Reducing the slider value by 10 units corresponds to a 300K drop in illuminant temperature.&lt;br /&gt;
* Try with a value of -23.&lt;br /&gt;
&lt;br /&gt;
====High dynamic range image + Ciecam====&lt;br /&gt;
&lt;br /&gt;
The image is a difficult one (the same that was used for the CIECAM example in the Advanced tab). It has very marked shadows and strong sunlit backlighting. Use the default RawTherapee settings and position the lockable color pickers as shown so that you can see the changes when processing.&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ctjOWX2lVmgcAzJtBwt69FGpxZOq-LyP/view?usp=sharing]&lt;br /&gt;
[[File:ciecam_light_prepa.jpg|600px|thumb|center|Ciecam Lighting Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding + Ciecam=====&lt;br /&gt;
&lt;br /&gt;
Create a full-image spot and then &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding. For this example, and for comparison with [[Local_Adjustments#Using_Log_Encoding | Lift the shadows]], the following arbitrary settings are used:&lt;br /&gt;
&lt;br /&gt;
* Set the value of Scope = 79&lt;br /&gt;
* Complexity = Advanced.&lt;br /&gt;
* Press the Automatic button.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog1.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
* Move the RT-spot and observe the effect.&lt;br /&gt;
* Change the Scope settings and observe the effect.&lt;br /&gt;
&lt;br /&gt;
=====Adjusting the Ciecam settings in the Log Encoding module=====&lt;br /&gt;
&lt;br /&gt;
* In the Scene Conditions panel choose Surround = Dim. The image will become lighter.&lt;br /&gt;
* In the Image Adjustments panel, set the Saturation(s) = 30 and Contrast (J) = -10.&lt;br /&gt;
* Observe the effect on the shadows.&lt;br /&gt;
&lt;br /&gt;
[[File:ciecamlog_cie.jpg|600px|thumb|center|Log encoding + Ciecam Saturation (s) - Contrast (J) - Dim]]&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;quot;All tools&amp;quot; expander.&lt;br /&gt;
* Try Colorfulness (M) instead of Saturation (s).&lt;br /&gt;
* Try Contrast (Q) instead of Contrast (J).&lt;br /&gt;
* Adjust the Lightness.&lt;br /&gt;
&lt;br /&gt;
====Log encoding - Dodge and Burn - Ciecam====&lt;br /&gt;
&lt;br /&gt;
=====Preparation=====&lt;br /&gt;
&lt;br /&gt;
This is another way to Dodge and Burn using Log Encoding and Ciecam.&lt;br /&gt;
Position an Rt-spot on the face and set 2 &amp;quot;Lockable color pickers&amp;quot; as shown.&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Jean Christophe Frisch - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1oyPu-U6CD1DjWuO8LuqJdIdDau1-2yY1/view?usp=sharing]&lt;br /&gt;
[[File:Dblogciecamprepa.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
=====Using Log Encoding in manual mode with Ciecam=====&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Add tool to current spot&amp;quot; &amp;gt; Log Encoding&lt;br /&gt;
* Complexity = Advanced&lt;br /&gt;
* Click on Automatic&lt;br /&gt;
* Slightly increase the White Ev value until you get the desired effect (in this example from 3.0 to 5.0).&lt;br /&gt;
* Slightly increase the Saturation (s).&lt;br /&gt;
* Click on &amp;quot;All tools&amp;quot; and slightly reduce Brightness (Q).&lt;br /&gt;
* Try the other settings e.g. Surround = Dim, Lightness (J), etc.&lt;br /&gt;
* You can also adjust the Scope and move the RT-spot and observe the variations in the result.&lt;br /&gt;
&lt;br /&gt;
[[File:Dblogciecam.jpg|600px|thumb|center|Log encoding Dodge and Burn - Preparation]]&lt;br /&gt;
&lt;br /&gt;
==='''Log Encoding and Highlight Recovery'''===&lt;br /&gt;
&lt;br /&gt;
The use of Log Encoding can sometimes lead to unexpected results. If the image contains highlights that were overexposed during shooting, then they need to be recovered or reconstructed. However, if this is the case, the Log Encoding module will &amp;quot;overwrite&amp;quot; the reconstructed highlights, resulting in unpleasant effects (e.g. unexpected changes in luminosity, hue and saturation).&lt;br /&gt;
We will use 2 methods to overcome this problem and preserve the highlights. &lt;br /&gt;
* Using a mask and a recovery process.&lt;br /&gt;
* Using excluding spots.&lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
Raw file (Pixls.us Jonathan Dumaine - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1I-Y6xqFoYMaxj9v3uEcvXfZomuJxyX6R/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
PP3 File [https://drive.google.com/file/d/1JQG52i76FxFWUWqi4Mz_5seWpLD-rvT6/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Preliminary adjustments&lt;br /&gt;
* Adjust the white balance (Color tab). Without the knowledge of the person who took this image we don't know anything about the lighting conditions. Are they LED or incandescent lamps? How was the foreground lit? In this case:&lt;br /&gt;
** You can either leave the image as is, &lt;br /&gt;
** or use the &amp;quot;Temperature correlation&amp;quot; automatic white balance method.&lt;br /&gt;
* Reconstruct the highlights (Exposure tab). I have used the excellent Color Propagation algorithm designed by Emil Martinec. &lt;br /&gt;
&lt;br /&gt;
Preparation of the RT-spot &lt;br /&gt;
* Choose Rectangle. &lt;br /&gt;
* Position the delimiters outside the preview area. &lt;br /&gt;
* Set the transition to a fairly high value. &lt;br /&gt;
* Position a series of Lockable Color Pickers on the image.&lt;br /&gt;
* Ensure that the L*a*b* values of the Lockable Color Pickers match the actual values by setting Mask and Merge &amp;gt; &amp;quot;Background color/luma mask” = 0 in the Settings module. &lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-prepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
====Apply Log Encoding====&lt;br /&gt;
&lt;br /&gt;
* Add the Log Encoding tool using &amp;quot;Add tool to current spot&amp;quot;. &lt;br /&gt;
* Select Advanced (or Standard).&lt;br /&gt;
* Click on the Automatic button. &lt;br /&gt;
* Set Scope to a high value i.e. 80 or more.&lt;br /&gt;
&lt;br /&gt;
Log Encoding will automatically adjust the image and in particular the foreground, but the colors in the previously &amp;quot;reconstructed&amp;quot; highlights in the background will be desaturated and the brightness will be reduced. &lt;br /&gt;
&lt;br /&gt;
Not only that, but the overall image is too saturated and the changes in exposure are badly distributed.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-log.jpg|600px|thumb|center|Log encoding]]&lt;br /&gt;
&lt;br /&gt;
====Elaboration of the mask====&lt;br /&gt;
&lt;br /&gt;
We will create a different sort of mask compared to what we normally use in RawTherapee. This mask will be used &amp;quot;live&amp;quot; to combine two images processed with and without Log Encoding.&lt;br /&gt;
&lt;br /&gt;
Depending on the settings of &amp;quot;Recovery based on luminance mask&amp;quot;: &lt;br /&gt;
* The dark and black areas of the mask will result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The very bright or white areas of the mask will also result in a combined image that is as close as possible to the original. &lt;br /&gt;
* The intermediate area will be modified by the settings of Log Encoding.&lt;br /&gt;
&lt;br /&gt;
In this case I used the LC(H) curve but other images may require the L(L) curve. Note that the C(C) curve has no effect on the &amp;quot;mix&amp;quot; but can be used to improve the selection.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-mask.jpg|600px|thumb|center|Mask]]&lt;br /&gt;
&lt;br /&gt;
====Partial recovery of highlights with mask====&lt;br /&gt;
&lt;br /&gt;
* Make sure that the mask is enabled i.e. the &amp;quot;Enable mask&amp;quot; box is checked. &lt;br /&gt;
* Open the expander &amp;quot;Recovery based on luminance mask&amp;quot;. &lt;br /&gt;
* Set &amp;quot;Recovery threshold&amp;quot;. The closer the slider is to &amp;quot;2&amp;quot;, the more the dark and very bright areas of the mask will be taken into account and restored to the original image values.&lt;br /&gt;
* Use the &amp;quot;Dark area luminance threshold&amp;quot; and &amp;quot;Light area luminance threshold&amp;quot; sliders to include or exclude parts of the image. The corresponding values (in this case dark = 25.5 and Light = 98.3) are the two limits below and above which the effect of the mask will be progressively taken into account. &lt;br /&gt;
* If necessary, use “Decay strength” to adjust the rate of decay.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-recov.jpg|600px|thumb|center|Recovery]]&lt;br /&gt;
&lt;br /&gt;
====Highlight Recovery using an Excluding spot====&lt;br /&gt;
&lt;br /&gt;
We can also use one of the strong points of Local Adjustments by using Excluding spots. The adjustments are arbitrary.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-exclu.jpg|600px|thumb|center|Excluding spots]]&lt;br /&gt;
&lt;br /&gt;
====Final adjustment with Ciecam16====&lt;br /&gt;
&lt;br /&gt;
Once the various parameters have been set, we can refine the result. In this case I have chosen several Ciecam settings (using Ciecam 2016 in this case) to: &lt;br /&gt;
* Increase the contrast. &lt;br /&gt;
* Reduce the saturation, especially for the skin. &lt;br /&gt;
* Change the chromatic adaptation, to make the image a little &amp;quot;colder&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of course, everything is quite arbitrary and depends on one's perception.&lt;br /&gt;
&lt;br /&gt;
A final remark. &lt;br /&gt;
* The image is particularly noisy and will need to be denoised. However, to keep things simple, I have excluded this from the example.&lt;br /&gt;
&lt;br /&gt;
[[File:loghigh-ciecam.jpg|600px|thumb|center|Ciecam16]]&lt;br /&gt;
&lt;br /&gt;
==='''Other Examples Log Encoding'''===&lt;br /&gt;
&lt;br /&gt;
* In this example we are going to use the Log Encoding tool (derived from the darktable filmic module and adapted by A. Griggio for ART). The tool has undergone further adaptation by J. Desmis for use in RawTherapee Local Adjustments.&lt;br /&gt;
* To demonstrate the possibilities of this module, we are going to use it to make a luminance gradient, without using the Graduated Filter in the Log Encoding menu. &lt;br /&gt;
*There are three steps: preparation, automatic settings, adjustments. &lt;br /&gt;
&lt;br /&gt;
====Preparation====&lt;br /&gt;
&lt;br /&gt;
* Set the RT-spot so that: &lt;br /&gt;
** The center is at the bottom left corner of the image.&lt;br /&gt;
** The upper right corner is at the limits of the image.&lt;br /&gt;
* Go to &amp;quot;Add tool to current spot&amp;quot; then select Log Encoding (the tool has been deliberately disabled in the screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:encodlogprepa.jpg|600px|thumb|center|Preparation]]&lt;br /&gt;
&lt;br /&gt;
Raw file (Copyright - Roberto Posadas - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
&lt;br /&gt;
====Automatic settings====&lt;br /&gt;
&lt;br /&gt;
* Press the Automatic button. &lt;br /&gt;
* The image will brighten.&lt;br /&gt;
* Click the Automatic button again to see the settings more clearly.&lt;br /&gt;
* The values Black Ev = -6.7, White Ev = 6.9, indicate a large dynamic range = 13.6 EV. &lt;br /&gt;
* “Source gray point” = 1.2 (slider changed to “Mean luminance (Yb%)” in the Scene Conditions&lt;br /&gt;
&lt;br /&gt;
==='''Using the Cam16 and HDR functions'''===&lt;br /&gt;
====Preamble====&lt;br /&gt;
The Cam16 color appearance module (Cam16 &amp;amp; JzCzHz) can also take into account certain aspects of HDR images. However, we need to keep in mind that Log Encoding, JzCzHz and Cam16 are only part of the overall HDR processing chain. Other aspects such as the HDR monitor characteristics (including the LCMS code) will need to be included in the future. &lt;br /&gt;
&lt;br /&gt;
====Differences compared to the Color Appearance &amp;amp; Lighting (Ciecam02/16) module (Advanced tab)====&lt;br /&gt;
* Takes into account the specific aspects of Local Adjustments (deltaE, transitions, masks etc.).&lt;br /&gt;
* Has a simpler chromatic adaptation process.&lt;br /&gt;
* Has fewer curves.&lt;br /&gt;
* Has a simplified PQ (Perceptual Quantizer) function: PQ, which is positioned at the beginning of the Cam16 processing pipeline, changes the way the Brightness (Q), Lightness (J), Colorfulness (M), Saturation (s) and Chroma (C) values are calculated internally.&lt;br /&gt;
* Allows Log Encoding Q or Sigmoid Q to be used with or without the Black Ev and White Ev values (dynamic range).&lt;br /&gt;
&lt;br /&gt;
====Some important points====&lt;br /&gt;
* The scene-condition values are calculated by the Cam16 algorithms and a process located upstream of Local Adjustments, just after the input profile, the demosaicing, and the choice of the working profile, all of which are in linear mode.&lt;br /&gt;
* The RGB=&amp;gt;Lab conversions at the beginning of the Local Adjustments (LA) process and Lab=&amp;gt;RGB at the end of the LA process do not change the dynamic range (DR). If an image has a DR of 15Ev before the LA module, it has approximately the same value after the LA module (any differences will be due to user adjustments).[[CIECAM02#Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz) | Jzazbz - a new experimental CAM? (Cam16 &amp;amp; JzCzHz)]]. However, while Lab allows low light levels (less than 0.005 cd/m2) to be taken into account, this is not the case for highlights &amp;gt; 120 cd/m2 because of the use of gamma. Nevertheless, Lab preserves highlights with values &amp;gt;120 cd/m2 and can be thought of as a form of data compression. Future developments will have to take into account the higher highlight values (HDR-Lab, output process, etc.).&lt;br /&gt;
* If in Settings you check the 2 boxes &amp;quot;Avoid color shift&amp;quot; and &amp;quot;Munsell correction only&amp;quot;, the whole local-adjustments process will maintain a constant hue whatever the changes made to the saturation.&lt;br /&gt;
&lt;br /&gt;
====Cam16 with HDR pre-processing====&lt;br /&gt;
A new integrated processing approach, allows the user to:&lt;br /&gt;
* Better exploit the potential of Cam16, recognised for its ability to take account of the physiological aspects of image processing.&lt;br /&gt;
* Integrate HDR processing upstream of Ciecam – Cam16 if need be.&lt;br /&gt;
If this is your first contact with Cam16, or if you're put off by technical details, you can skip the next paragraph. &lt;br /&gt;
=====There are two major difficulties implementing Cam: variables in 6 dimensions and the specificities of the brightness function Q =====&lt;br /&gt;
======Cam and the 6 dimensions======&lt;br /&gt;
It's necessary to touch on the programming aspects of Cam16 (the same applies to Cam02) to understand the difficulties and constraints. During the development of Ciecam, around 2011-2012, it quickly became apparent that unlike working in RGB, XYZ or Lab mode, which requires 3-dimensional variable declarations, Ciecam requires 6 dimensions: J (luminance), Q (brightness), C (chromaticity), S (saturation), M (colorfulness) and h (hue). This requires considerable memory and significant processing times. It was therefore decided to process the variables sequentially, one at a time, in a global loop to limit the memory requirements. However this presents a major problem because optimising a procedure called in the middle of the loop is practically impossible. As a result, optimisation of functions such as contrast, sigmoid, etc. is limited and global.&lt;br /&gt;
&lt;br /&gt;
Cam16 also introduces the ability to:&lt;br /&gt;
* Lift the shadows (Lighting).&lt;br /&gt;
* Carry out perceptual processing of the highlights, which complicates the use of HDR processing techniques such as log encoding.&lt;br /&gt;
&lt;br /&gt;
======Particularities of Q - Brightness======&lt;br /&gt;
* By design, Q (brightness), unlike J (lightness), L (L*a*b*) and luminance calculations in RGB, HSV and other modes, is calculated from absolute luminance and has no fixed limits (0..1, 0..65535).&lt;br /&gt;
* When J is in the interval [0, 1], the value of Q can reach values of 5 or 10, depending on the scene conditions. This is a very strong constraint on the references used by the algorithms (average, thresholds, etc.) and makes it difficult to automate them.&lt;br /&gt;
* However, in the majority of cases, Q results in a more natural rendering, closer to human perception.&lt;br /&gt;
&lt;br /&gt;
======Removal of the HDR modules - &amp;quot;Log encoding Q&amp;quot; and &amp;quot;Sigmoid Q&amp;quot; - previously integrated into Cam16, Image Adjustments======&lt;br /&gt;
[[File:sourcedata1.jpg|thumb|400px|Source Data Adjustments]]In view of the difficulties described in the two previous paragraphs, it was decided:&lt;br /&gt;
* To place the HDR or colorimetry tools in the Source Data Adjustments module, located upstream of the Ciecam – Cam16 process. It is integrated in the Color Appearance GUI so that the user does not have to switch tools. This module contains a number of functions that are more or less useful depending on the nature of the image:&lt;br /&gt;
** Log encoding: it encodes the data logarithmically to allow high-dynamic-range images to be processed correctly. Of course you can use this tool for all images, but it is only really useful if the dynamic range is in the order of 10 Ev or more. Using this tool when it isn’t necessary can lead to a change in the overall colorimetry that is not always easy to recover. The &amp;quot;Brightness compression&amp;quot; slider is used to limit the action for high luminance values.[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_the_%E2%80%9Clacam16%E2%80%9D_development_branch | An evaluation of the dynamic-range capabilities of tools]]&lt;br /&gt;
** Tone Response Curve (TRC) &amp;amp; Midtones: in the majority of cases, this module allows you to modify underexposed images (with deep shadows), or images where there are problems with luminance balance. This approach is identical to the other modules using this TRC in Rawtherapee.&lt;br /&gt;
*** Gamma: modifies the effect on the highlights.&lt;br /&gt;
*** Slope: allows you to lighten the shadows.&lt;br /&gt;
*** Midtones: adjusts midtones.&lt;br /&gt;
*** Highlight attenuation: completes the processing carried out by gamma, slope and midtones by causing a slight lowering of highlights. Please note this does not replace Highlight reconstruction.&lt;br /&gt;
&lt;br /&gt;
** Primary &amp;amp; Illuminant lets you:&lt;br /&gt;
*** Adjust the colorimetry of images where for example, a mixture of illuminants leads to visible drift (e.g. LEDs), or where the shooting conditions (stdA illuminant, predominantly red flowers, etc.) lead the system to unsatisfactory responses (exaggerated saturation of blues or reds, etc.).&lt;br /&gt;
*** Be careful if you change the Working Profile (Color Tab), which is Prophoto by default, you will need to adapt the &amp;quot;Destination primaries&amp;quot; (this is not automatic).&lt;br /&gt;
*** Modify the colors or saturation of an image locally or globally:&lt;br /&gt;
**** The system calculates the xy values of the dominant color of the image and displays them (gray point) on the CIExy diagram;&lt;br /&gt;
**** Moving the &amp;quot;Refine colors (white-point)&amp;quot; slider will modify the saturation of the image.&lt;br /&gt;
**** Changing the position of this dominant colour using the &amp;quot;Shift x&amp;quot; and &amp;quot;Shift y&amp;quot; sliders will allow you to add or remove a dominant colour (hue and saturation) without changing the primaries.&lt;br /&gt;
*** Gamut control: provides gamut control, particularly if the primaries have been changed.&lt;br /&gt;
*** Matrix adaptation: 4 choices - Bradford, Cat16, Cat02, Von Kries, XYZ scale - provides chromatic adaptation when the primaries are changed.&lt;br /&gt;
&lt;br /&gt;
Some of these tools are similar to the Abstract Profile concept.&lt;br /&gt;
[[Color_Management#Abstract_Profiles | Abstract Profiles]]&lt;br /&gt;
&lt;br /&gt;
=====Source Data Adjustments and Scene conditions=====&lt;br /&gt;
I won't go back over what Scene Conditions does (see the tutorials on Ciecam), even though this concept is more complex and misunderstood than many users think. As a brief reminder, Scene Conditions' (or “scene referred”, or “source”, depending on usage) takes into account the characteristics of the image at the time of shooting. This is to be distinguished from Viewing Conditions (or “display referred”, depending on usage) which takes into account the viewing environment. For example, the system used to display the image, its luminance and contrast (HDR or standard monitor, television, projector, printer, etc.), or the luminance of the background (in full sunlight, in a dark room, etc.). Be careful not to misuse the Viewing Conditions settings to compensate for imperfect Scene Conditions or Source Data Adjustments settings.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======What principles do &amp;quot;Log encoding&amp;quot; and Scene Conditions use to render an image prior to Cam16?======&lt;br /&gt;
[[File:whiteblackdisr.jpg|400px|thumb|White &amp;amp; Black distribution]]Cam16 needs information on:&lt;br /&gt;
* Absolute luminance: this is calculated from the Exif data at the time of shooting: speed, aperture, exposure compensation, etc.&lt;br /&gt;
* Mean luminance, also known as &amp;quot;gray point&amp;quot;. This calculation is carried out as described in the paragraph below.&lt;br /&gt;
&lt;br /&gt;
To process high-dynamic-range images, you need to calculate the values required for the logarithmic conversion:&lt;br /&gt;
* BlackEv and WhiteEv, as well as the &amp;quot;gray point&amp;quot; mentioned above.&lt;br /&gt;
&lt;br /&gt;
Where should these values be taken, and how should they be calculated? The logic of Scene Conditions leads us to place ourselves as far upstream as possible in the processing process while still having access to useful data.&lt;br /&gt;
ART originally chose to take a copy of the image data just after demoisaicing.&lt;br /&gt;
The disadvantage of this choice is that by definition, the image is not processed and the colour and light distribution is poorly known and unreliable.&lt;br /&gt;
The difficulty introduced by logarithmic conversion to compress the data (Log 2) is that it is not linear.&lt;br /&gt;
&lt;br /&gt;
Digital noise must therefore be taken into account and the minimum and maximum RGB values as well as the gray point need to be estimated. These adjustments should also take into account possible subsequent changes in luminance. More or less empirical formulas for calculating average luminance and the resulting gray point have been developed by the original designers. Nevertheless, the result can be disappointing.&lt;br /&gt;
&lt;br /&gt;
In practice, once the calculations have been made manual adjustments are still required for at least BlackEv, WhiteEv, “Mean luminance Yb%” (gray point) for the source data, and or “Mean luminance Yb%” (gray point ) for the Viewing Conditions (not to be confused with source data adjustments), and other subsequent luminance adjustments. Hence the difficulty of obtaining a result intuitively.&lt;br /&gt;
&lt;br /&gt;
To try and solve this problem, I chose to add two extreme white and black adjustment settings. I've called them “Whites distribution” and “Blacks distribution”. There are obviously no general rules for processing an image, you weaken or strengthen the most exposed or darkest part of the image copy. The internal algorithm recalculates the BlackEv, WhiteEv and Mean luminance (gray point) values, which must be consistent. The advantage is (I hope) a more intuitive system. There may be other ways (?) of achieving this; this one has the merit of working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These controls are only available if the Automatic check box in Scene Conditions is ticked.&lt;br /&gt;
&lt;br /&gt;
=====The application GUI has been simplified and made more intuitive, in particular through the use of Expanders=====&lt;br /&gt;
[[File:Cam16exp.jpg|600px|thumb|center|Simplified GUI]]&lt;br /&gt;
&lt;br /&gt;
=====Cam16 tutorial with an HDR image=====&lt;br /&gt;
I have chosen an image of the Alexandre III bridge in Paris, taken at the end of October 2021.&lt;br /&gt;
* Nikon Z6 II&lt;br /&gt;
* Raw file (Jacques Desmis - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/17G1H-7S2uCyDa92CiJf9g35jhegvCZu_/view?usp=sharing]&lt;br /&gt;
* pp3 file [[File:Alexandre3-1.pp3|Alex3-NEF.pp3]]&lt;br /&gt;
This image has a high dynamic range of just over 13.5Ev, with some areas of high exposure (luminance L &amp;gt;= 100).&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is not to demonstrate the 'best' way of processing this image, but to show that by integrating a pre-processing module upstream of Ciecam, you can process images with a very high dynamic range so that they can then be easily processed by Ciecam (Cam16).&lt;br /&gt;
&lt;br /&gt;
I've added a second example, unrelated to the Alexander III bridge, to show the possible use of the Tone Response Curve (TRC).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Preparation: establishing a good starting point and identifying the problems to be solved======&lt;br /&gt;
I decided to start with the following settings:&lt;br /&gt;
* Apply a Neutral profile.&lt;br /&gt;
* Apply White Balance: Auto - Temperature correlation.&lt;br /&gt;
* Activate “Highlight reconstruction”: Inpaint Opposed - “Gain threshold” = 0.82&lt;br /&gt;
&lt;br /&gt;
With these basic settings:&lt;br /&gt;
* The shadows in the upper right-hand part of the steel structure are completely lacking in detail.&lt;br /&gt;
* The highlights are acceptable (L = 97), with no apparent colour drift.&lt;br /&gt;
* The histogram shows that the red channel is out of bounds.&lt;br /&gt;
* The rendered image is not very appealing.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-neutr.jpg|600px|thumb|center|Neutral - Temperature correlation - Inpaint Opposed]]&lt;br /&gt;
======Apply Nikon Auto-Matched Tone Curve rendering======&lt;br /&gt;
By default Rawtherapee loads the Nikon Z6 II rendering profile.&lt;br /&gt;
&lt;br /&gt;
Observation:&lt;br /&gt;
* The image looks more pleasing, more balanced.&lt;br /&gt;
* The shadows have even less detail.&lt;br /&gt;
* The highlights are out of range (L &amp;gt;= 100).&lt;br /&gt;
[[File:Alex3-automatch.jpg|600px|thumb|center|Nikon – Auto-Matched]]&lt;br /&gt;
&lt;br /&gt;
======Correct the dynamic range======&lt;br /&gt;
* Activate the Source Data Adjustments expander.&lt;br /&gt;
* Activate Log Encoding.&lt;br /&gt;
Examine the result:&lt;br /&gt;
* High Dynamic Range: 13.6Ev (according to the calculations).&lt;br /&gt;
* Detail has been restored to the shadows (probably too much)!&lt;br /&gt;
* The highlights are within acceptable limits L=98.&lt;br /&gt;
* The histogram shows an overshoot in the reds.&lt;br /&gt;
* The overall image is too bright.&lt;br /&gt;
[[File:Alex3-logencode.jpg|600px|thumb|center|Use Log encoding only]]&lt;br /&gt;
&lt;br /&gt;
To increase the shadows and reduce the highlights:&lt;br /&gt;
* Set (Scene Conditions) “Whites distribution” to -74 and “Black distribution” to -59: these choices are fairly arbitrary and depend on the perception of the user.&lt;br /&gt;
* Set Midtones (Source Data Adjustments) to -70, to restore a more acceptable average luminance.&lt;br /&gt;
* Increase “Brightness compression” (Source Data Adjustments - Log encoding) to 0.90 to lower the brightness a little.&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-dynamic1.jpg|600px|thumb|center|Use Scene Conditions &amp;amp; Source Data Adjustments]]&lt;br /&gt;
&lt;br /&gt;
======Make the Seine look more “summery”======&lt;br /&gt;
The autumn weather (and the cleanliness of the Seine?) make the water look unflattering.&lt;br /&gt;
&lt;br /&gt;
We are going to make it a little more pleasant.&lt;br /&gt;
Let's create a second RT-Spot (Scope = 60).&lt;br /&gt;
&lt;br /&gt;
In Source Data Adjustments, Tone Response Curves: Midtones = -70.&lt;br /&gt;
&lt;br /&gt;
In Primaries &amp;amp; Illuminant - go to “Dominant color”:&lt;br /&gt;
* Use the 2 sliders “Shift x” and “Shift y” to move the gray point representing the dominant colour.&lt;br /&gt;
* Shift x = 0.2, Shift y = -0.0454&lt;br /&gt;
* So that the white point, the gray point (dominant colour) and the black point representing the red primary are roughly aligned.&lt;br /&gt;
* By moving “Refine colors (white-point)”, we're going to change both the hue towards more blue/green and the saturation. Of course I could have made other choices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Alex3-seine1.jpg|600px|thumb|center|Use Dominant Color - 'La Seine' - blue]]&lt;br /&gt;
&lt;br /&gt;
=====A second example - Using the TRC or Surround - Truck under a tunnel=====&lt;br /&gt;
* Raw file(Copyright - Roberto Posadas - Common Attribution-share Alike 4.0): [https://drive.google.com/open?id=1RXoXp-AHWzo6mzbd-VyRTRvmRlFtyZDq]&lt;br /&gt;
* pp3 file [[File:Truck-tunnel-1.pp3|Truck-tunnel.pp3]]&lt;br /&gt;
* pp3 file 2 [[File:Truck-tunnel-2.pp3|Truck-tunnel.pp3 - 2 spots]]&lt;br /&gt;
* pp3 file 3 [[File:Truck-tunnel-3.pp3|Truck-tunnel.pp3 - Surround]]&lt;br /&gt;
======Image d'origine======&lt;br /&gt;
[[File:Van-tunnel-0.jpg|600px|thumb|center|Image initiale]]&lt;br /&gt;
&lt;br /&gt;
======Image with Source Data Adjustments - Tone Response Curve &amp;amp; Midtones======&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
* Note that the settings are simplified and intuitive:&lt;br /&gt;
** Gamma = 2.90: brightens highlights.&lt;br /&gt;
** Slope = 80: lightens shadows.&lt;br /&gt;
[[File:Van-tunnel.jpg|600px|thumb|center|Use TRC]]&lt;br /&gt;
&lt;br /&gt;
======Image with Scene Conditions - Surround======&lt;br /&gt;
Here, it's even simpler.&lt;br /&gt;
&lt;br /&gt;
* Scope = 60;&lt;br /&gt;
Scene conditions:&lt;br /&gt;
* Surround = Dark.&lt;br /&gt;
Source Data Adjustments:&lt;br /&gt;
* Smooth Highlights = enabled&lt;br /&gt;
Cam16 Image Adjustments:&lt;br /&gt;
* Contrast J = 24.&lt;br /&gt;
[[File:Van-tunnel-surround.jpg|600px|thumb|center|Use Surround]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Comparison between the two TRC (tone response curve) tools in RawTherapee and the impact of Ciecam=====&lt;br /&gt;
There are two TRC tools in RawTherapee, one in the Abstract Profile module in Color Management, and the other in the Source Data Adjustments module in the Local Adjustments, Color Appearance tool. &lt;br /&gt;
&lt;br /&gt;
The Abstract Profile and Source Data Adjustments modules are nearly identical except for an additional log-encoding function integrated into the latter. This tool should be reserved for extreme cases that can’t be solved any other way. This is because the way they are rendered can be unpredicatable and often disturbs the balance of light and colour.&lt;br /&gt;
&lt;br /&gt;
They are both based on the use of a virtual profile to modify the data. They include:&lt;br /&gt;
* A Tone Response Curve with a Gamma slider for adjusting the highlights and a Slope slider for the shadows. &lt;br /&gt;
* Two additional sliders or settings - checkbox or combobox (Source Data Adjustments - SDA) - for adjusting the midtones and the highlights :&lt;br /&gt;
** Midtones &lt;br /&gt;
** Highlight Attenuation &amp;amp; RGB Channels&lt;br /&gt;
*** Ev based : which can be used to soften strong highlights with Ev values between 0 and +12.&lt;br /&gt;
*** Gamma based (Source Data Adjustments): Can be used to soften strong highlights by using the Mean Scene luminance Yb% of an asymptotic polynomial function.&lt;br /&gt;
*** Slope based (Source Data Adjustments) : Combine Gamma based with a tone mapping function using Slope. The system is capable of restoring 23 to 24 Ev. The Slope slider allows you to adjust the balance between the shadows and the highlights. The Scene value of Yb% is taken into account to scale the algorithm.&lt;br /&gt;
*** Sigmoid based (Source Data Adjustments): inspired by Darktable code and modified to be as automatic as possible, taking into account the calculated values ​​of Black Ev, White Ev, Mean Luminance (Yb) Scene, and Display White point (cd /m2). It has 3 sliders including Contrast with lower base values ​​than in ART and Darktable (position in the process, taking into account calculated data, etc.), Skew which positions the sigmoid between the shadows and the lights and Display White point.&lt;br /&gt;
*** RGB Channel Slope (Source Data Adjustments): similar to 'Slope based', allowing you to act separately on the 3 channels R, G, and B. Three controls have been added to a) take into account Yb% value in viewing conditions; b) adapt the rendering by maintaining the overall brightness; c) adapt the point (near Mean Luminance Yb) from which the attenuation of the highlights occurs.&lt;br /&gt;
 [[File:highattenuation1.jpg|600px|thumb|center|Highlight Attenuation and RGB Channels]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Primaries &amp;amp; Illuminant, for adjusting the image colorimetry. The user can choose the illuminant and adjust the dominant colour.&lt;br /&gt;
 [[File:Primdom.jpg|600px|thumb|center|Primaries and Dominant color]]&lt;br /&gt;
* Adjusting the dominant color can be done by moving the white point towards the calculated color dominant (gray point on the diagram) via Refine colors (white-point), or moved by changing the values of Shift x and Shift y.&lt;br /&gt;
* You can use the Primaries module to create a Channel Mixer and switch to black and white&lt;br /&gt;
======Position in the pipeline======&lt;br /&gt;
The Abstract Profile is at the end of the process, just before Color Appearance &amp;amp; Lighting.The Source Data Adjustments module, which is integrated into the Color Appearance (CAM16 &amp;amp; JzCzHz) tool in Local Adjustments, is located just after white balance, near the beginning of the pipeline.&lt;br /&gt;
The difference in the respective positions of these two modules will lead to a difference in behaviour with regard to shadows and highlights:&lt;br /&gt;
* Source Data Adjustments is located prior to Exposure, the Auto-matched Tone Curve, and the other sliders and curves located in the Exposure tab.&lt;br /&gt;
* It uses demosaiced RGB data for internal and scene condition calculations.&lt;br /&gt;
* The Abstract Profile uses RGB data values calculated at the end of the pipeline.&lt;br /&gt;
The shadow and highlight distribution will therefore depend on prior user adjustments and the action of the Auto-matched Tone curve, which will in turn vary with the type of image and camera.&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Gamma and Slope sliders will also be different in the two cases: In general, lower values will be needed in the Source Data Adjustments module compared to the Abstract Profile module. The choice of primaries and illuminants will also give different results, notably with respect to the dominant color. &lt;br /&gt;
&lt;br /&gt;
======The Influence of Ciecam======&lt;br /&gt;
The Abstract Profile is independent of the Ciecam module , which comes just after it in the pipeline (Color Apearance &amp;amp; Lighting in the Color tab). If you activate Ciecam, the parameters of the Abstract Profile module will be taken into account.&lt;br /&gt;
The Source Data Adjustments module is integrated into the Local Adjustments Ciecam module (Color Appearance). The Source Data Adjustment settings will therefore be affected by the ensuing colour appearance model (CAM).&lt;br /&gt;
&lt;br /&gt;
======What does Ciecam do?======&lt;br /&gt;
We're not going to repeat the Ciecam tutorial here, but in simple terms Ciecam, as used in both Color Appearance and Lighting and Local Adjustments, is a software model that tries to take into account the physiological aspects due to the perception of the eye and the brain. &lt;br /&gt;
&lt;br /&gt;
Further information, albeit incomplete, on the effects taken into account by the two versions of Ciecam implemented in RT can be found here :&lt;br /&gt;
[[CIECAM02#Introduction_-_history | Ciecam History - effects]]&lt;br /&gt;
&lt;br /&gt;
Most of the effects are automatically taken into account by the software. Particularly in Source Data Adjustments.&lt;br /&gt;
&lt;br /&gt;
The Stevens effect is a special case. It is produced by the two 'surround' comboboxes in the scene and viewing conditions modules. For example the options in 'Scene conditions' are: Average, Dim, Dark, Extremely Dark.&lt;br /&gt;
&lt;br /&gt;
When these effects are taken into account, the image is modified in depth to bring it closer to the conditions in which it was shot and viewed. Of course, only the person who took the shot can fully recreate the context.&lt;br /&gt;
&lt;br /&gt;
A few comments on the impact of some of the effects that are taken into account:&lt;br /&gt;
&lt;br /&gt;
* Surround (Stevens effect) will lighten the shadows. The higher the surround effect (e.g. Dark), the more it will be necessary to reduce the action of the Tone Response Curve and in particular, the Slope.&lt;br /&gt;
* Simultaneous contrast, which is all the more important when the luminance differences in the image are large, will be taken into account automatically and will increase color saturation. This means that images where there is an imbalance between highlights and shadows - whether natural or artificially obtained by a mismatch between gamma (highlights) and slope (shadows) - will result in an exaggerated increase in saturation.&lt;br /&gt;
* The Hunt effect will (if Exif data is taken into account) be based on Absolute Luminance values.&lt;br /&gt;
&lt;br /&gt;
The settings in the Cam16 Image Adjustments module (in Local Adjustments) also take these effects into account. For example:&lt;br /&gt;
* Brightness Q (and contrast Q) are based on the Absolute Luminance value to differentiate them from Lightness (J) and Contrast (J).&lt;br /&gt;
* Saturation (s), will increase the sensation of colour in a differentiated way and have less effect in the shadows compared to Chroma (C).&lt;br /&gt;
&lt;br /&gt;
To summarise for Source Data Adjustments:&lt;br /&gt;
* the more you act on Surround (Scene), the more you need to reduce the Slope and Gamma parameters compared with those in the Abstract Profile module.&lt;br /&gt;
* Colour saturation will be directly affected by large values of Slope and Gamma. You can adjust this if necessary using the Saturation slider (Cam16 Image Adjustments). The system is under your control, there is no AI (Artificial Intelligence).&lt;br /&gt;
* the fact that CAM effects are taken into account when adjusting the parameters in the Source Data Adjustments module means that there will be an impact on the distribution of light and shadow and on the colours. It is impossible to transpose Abstract Profile settings (at least those relating to luminance: gamma, slope, midtones, etc.) to Source Data Adjustments and vice versa other than reducing their overall values.&lt;br /&gt;
&lt;br /&gt;
======Summary======&lt;br /&gt;
Ciecam, particularly in its latest version Cam16 (2020, 2022) is a very high quality tool (even if it's not perfect). To my knowledge, it's the only one to combine almost all the concepts of Colour Appearance Models (CAM), which is not the case with other systems such as CieLab OKLab, Jzazbz, etc.:&lt;br /&gt;
* Separation into 3 processes: Scene conditions, Image Adjustments, Viewing conditions;&lt;br /&gt;
* Tools and processes to take into account the physiological aspects of the human eye-brain pair: simultaneous contrast, surround, chromatic adaptation, etc. ;&lt;br /&gt;
* Use of the 6 variables required for a CAM: lightness (J), brightness (Q), chroma (C), saturation (s), colourfulness (M), hue (h).&lt;br /&gt;
&lt;br /&gt;
However, it does have one shortcoming, which can be a handicap in the case of difficult images (with high dynamic range, for example): it doesn't take into account the overall mapping of the image, because Cam16 works pixel by pixel. &lt;br /&gt;
&lt;br /&gt;
The Source Data Adjustments module provides a partial solution to this problem. It performs a global analysis of tones and colours using the associated tools (Log encoding, Tone Response Curve with Midtones, etc.).&lt;br /&gt;
It is partially associated with Cam16. In other words, changes induced by Source Data Adjustments will be taken into account by Cam16, but without any judgement being made as to their relevance. For some images, Source Data Adjustments settings or downstream processes (exposure, etc.), may mean that the image becomes too contrasty in certain areas, or too saturated, particularly in the shadows.&lt;br /&gt;
&lt;br /&gt;
It is up to the user to use the tools available in Image Adjustments (saturation, brightness, etc.) either on the entire image, or with the help of an additional RT-spot on the areas concerned. Similarly, the extensive processing of shadows often leads to an increase in noise, which needs to be controlled. The denoise tool in Blur/Grain &amp;amp; Denoise should help to remedy this.&lt;br /&gt;
&lt;br /&gt;
=====Rawtherapee Processing Challenge feedback=====&lt;br /&gt;
Evaluation of the Source Data Adjustments 'SDA' module in Rawtherapee Processing Challenge -March and April 2024. &lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Evaluation of the SDA module]]&lt;br /&gt;
&lt;br /&gt;
==='''Ciecam -JzCzHz  Tutorial'''===&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial| Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz) - Tutorial]]&lt;br /&gt;
&lt;br /&gt;
==='''An experimental JzCzHz module''' ===&lt;br /&gt;
For a brief explanation of this module, see the following:&lt;br /&gt;
[[CIECAM02#Jzazbz_-_a_new_experimental_CAM.3F_.28Cam16_.26_JzCzHz.29| Experimental tool - JzCzHz]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings - General====&lt;br /&gt;
For a brief explanation of this module, see the following :[[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_General]]&lt;br /&gt;
&lt;br /&gt;
====Understanding the CAM - SDR - HDR settings -Introduction====&lt;br /&gt;
For a brief explanation of this module, see the following [[CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction|CIECAM02#Understanding_the_CAM_-_SDR_-_HDR_settings_-_Introduction]]&lt;br /&gt;
&lt;br /&gt;
=====Jz in practice=====&lt;br /&gt;
[[File:Jzsettings.jpg|600px|thumb|center| 6 Jz settings]]&lt;br /&gt;
There are 6 settings that interact with Jz:&lt;br /&gt;
* &amp;quot;Mean luminance (Yb%)&amp;quot; is the average value (expressed in % of gray) of the image just after demosaicing. Moving the slider to the right will progressively darken the final result. This slider also affects the reference value used by Log encoding Jz and will change the apparent contrast of the image before the logarithmic conversion.&lt;br /&gt;
* &amp;quot;Absolute luminance&amp;quot;, La (described above), allows you to correct the value if necessary as follows:&lt;br /&gt;
** To act on the common CAM (Color Appearance Model) module to take into account the actual value used by Jz and Q.&lt;br /&gt;
** To modify the useful amplitude of the Jz values in the code (which we have seen were very low), by interacting non-linearly with the &amp;quot;PU adaptation&amp;quot; (Perceptual uniform adaptation) slider (my interpretation). High values of La will increase the internal values of Jz, whose rendering is not linear because of the PQ function.&lt;br /&gt;
* &amp;quot;PU adaptation&amp;quot; allows the user to adjust the internal values of Jz independently of the values of La. &lt;br /&gt;
* &amp;quot;Jz reference 100 cd/m2&amp;quot;. This slider, which should be left as is for the moment, corresponds to the 8 bit/10 bit ratio of Jz values between SDR (100 cd/m2) and HDR (10000 cd/m2 chosen by Dolby). It has been included because it may be necessary when the module is used with a true HDR monitor.&lt;br /&gt;
* “PQ-Peak luminance” translates the value of &amp;quot;Peak luminance&amp;quot; used internally by the PQ function. This value, which is used internally for all HDR calculations upstream of the monitor, is not the same as the value that can be allocated to the HDR monitor (when available). Try adjusting PQ and you will see a variation in the shadows and highlights as well as the saturation.&lt;br /&gt;
* These last 3 &amp;quot;Jz remapping&amp;quot; settings improve the adaptation of the internal Jz values. In order for the curves, sliders and tools to react correctly, a second correction is applied temporarily to these tools, to put Jz in the range [0..1].&lt;br /&gt;
* Surround (Average, Dim, Dark), takes into account the environmental conditions at the time of shooting. Was the background around the scene normal, rather dim, or very dark? Adjusting this setting will change the appearance of the image by gradually lightening it.&lt;br /&gt;
* Try adjusting these 6 settings but be careful because some of them only have an effect when used in conjunction with Jz adjustments (Log Encoding, Sigmoid Jz, JzczHz adjustments).&lt;br /&gt;
* You can see the impact of these settings in the console, for example:&lt;br /&gt;
La=250.0 PU_adap=1.6 maxi=0.018249 mini=0.000016 mean=0.002767, avgm=0.249170 to_screen=42.941518 Max_real=0.783651 to_one=1.276078&lt;br /&gt;
Where: &lt;br /&gt;
* &amp;quot;to_screen&amp;quot; is the multiplier applied to Jz, for the actual processing.&lt;br /&gt;
* &amp;quot;to_one&amp;quot; is the second multiplier allowing the curves and various functions to work in the range [0..1].&lt;br /&gt;
&lt;br /&gt;
====HDR tools Sigmoid Jz and Log Encoding====&lt;br /&gt;
The Jz version of Log Encoding is similar in concept to the [[Local_Adjustments#Log_Encoding_and_Ciecam02_Tutorial | Log Encoding module]]. The main difference is the way luminance is evaluated. In Log Encoding, the module works in RGB mode and can produce hue shifts if the evaluation is not perfect.&lt;br /&gt;
&lt;br /&gt;
In the case of Log Encoding Jz the luminance uses Jz and behaves like a CAM. The only color variations are those that have been introduced in the conversion matrices by the researchers. The evaluations carried out on Jz give very good results, similar to Cam16, and do not introduce hue shifts.&lt;br /&gt;
&lt;br /&gt;
The choice of Jz for the luminance component (instead of RGB) also changes the way the values of &amp;quot;Mean luminance (Yb%)&amp;quot; and &amp;quot;Viewing luminance (Yb%)&amp;quot; are taken into account, in particular with respect to the calculation of the 2 gray points.&lt;br /&gt;
&lt;br /&gt;
For Log encoding Jz and Sigmoid Jz, a calculation using image data just after demosaicing evaluates the values of: a) Black Ev (darkest point of the image), b) White Ev (lightest point of the image), c) &amp;quot;Mean luminance (Yb%)&amp;quot;. &lt;br /&gt;
* These values are used in logarithmic mode and luminance Jz becomes &amp;quot;(log2(Jz) - black Ev)/Dynamic Range)&amp;quot;. &lt;br /&gt;
* For Log encoding Jz a unique solution to the logarithmic equation is calculated from the values of a), b) and &amp;quot;Viewing mean luminance (Yb%)&amp;quot; to linearize (or re-linearize) the values. The value of c) influences the distribution of the contrast, without interfering with the calculation. We will see that it is different with &amp;quot;Sigmoid Jz&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Sigmoid Jz'''&lt;br /&gt;
[[File:Sigmoidjz1.jpg|600px|thumb|center| Tone-mapping - Sigmoid Jz]]&lt;br /&gt;
* See [[CIECAM02#Sigmoid_Jz | Sigmoid Jz - principles]]&lt;br /&gt;
* Raw file (Rawtherapee - Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1ziux382pWgdYa4jySimwKaKnK_KdDhno/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, fitting an HDR image (in this case 14.8 Ev with an absolute luminance of 2000 cd/m2) into an SDR monitor (7 Ev, 120 cd/m2) without compromising anything is an impossible mission.&lt;br /&gt;
With Log encoding Jz or Sigmoid Jz the hue will be preserved, but the settings for the luminance distribution between the deepest shadows, the highlights and the midtones will depend on the user and the choices he makes.&lt;br /&gt;
For Log encoding Jz, the &amp;quot;Mean luminance (Yb%)&amp;quot; has a strong impact on the result by modifying the contrast. &amp;quot;Viewing mean luminance (Yb%)&amp;quot; will affect the overall luminance of the image. The other two settings Black Ev and White Ev, which are logarithmic, will, like &amp;quot;Mean luminance (Yb%)&amp;quot;, affect the distribution between the shadows and the highlights. It is obvious that the responses and therefore the settings are dependent on the image, the monitor, and the 6 settings&lt;br /&gt;
&lt;br /&gt;
==General principles and settings==&lt;br /&gt;
===The RT-spot object===&lt;br /&gt;
As mentioned previously, the approach used for local adjustments is similar to the method developed by Nik Software. There are however some major differences: &lt;br /&gt;
* Each RT-spot can be considered as an object with several event fields. There are about 640 such fields consisting of cursors, curves, combo-boxes, check-boxes, drop-down menus, masks, etc. In Basic mode, the number of event fields is limited to 160.&lt;br /&gt;
* The fields are organized in groups, which can be activated by the user and have variable values depending on the type of event. The groups are arranged in user-coherent sets: Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color appearance (Cam16 &amp;amp; JzCzHz), Dynamic Range &amp;amp; Exposure, Common Color Mask, Soft Light &amp;amp; Original Retinex, Blur/Grain &amp;amp; Denoise, Tone Mapping, Dehaze &amp;amp; Retinex, Sharpening, Local Contrast &amp;amp; Wavelets, Contrast by Detail Levels. There is also a Cam16 &amp;amp; JzCzHz Color Appearance module. See [[CIECAM02#Color_Appearance_.26_Lighting_.28CIECAM02.2F16.29_et_Color_Appearance_.28Cam16_.26_JzCzHz.29_-_Tutorial |Tutoriel Color Appearance &amp;amp; Lighting (CIECAM02/16) et Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
* Each RT-spot creates an additional &amp;quot;layer&amp;quot; similar to the way layers are added in bit-map editors. Each new RT-spot is transparent and allows the user to see any previous modifications. The Excluding Spot allows the user to access the original unmodified image (prior to any local adjustments) and can be used to exclude certain areas or simulate an inverse mode.&lt;br /&gt;
* All RT-spots in the Local Adjustments tab work exclusively in L*a*b* mode unlike the other tabs in RawTherapee which can use either RGB or L*a*b* after demosaicing.&lt;br /&gt;
** You may ask “Why use L*a*b* when it is supposedly limited to 7EV”? In fact the 7 EV limitation only applies to 8-bit ICC monitor profiles. You may also have heard that L*a*b* causes color shifts (blue-purple and red-orange). However this is only true if no correction is applied. &lt;br /&gt;
** If L*a*b* is used in 32-bit Real Mode along with RawTherapee’s Munsell correction (to correct color shifts), then in the vast majority of cases only the brightest highlights in HDR images will pose a problem. Tests on HDR images have shown that L*a*b* is capable of handling over 15Ev which is well beyond the range of ordinary monitors. If an HDR monitor is available then the JzCzHz module can be used as a first approach to HDR processing. &lt;br /&gt;
** For more information go to [[Toolchain Pipeline|Tool sequence in the pipeline - General colorimetry]]&lt;br /&gt;
* RT-spot objects are managed in a &amp;quot;for&amp;quot; loop (creation, modification, follow-up). &lt;br /&gt;
* There is no code duplication. For example the Denoise tool in &amp;quot;Blur/Grain &amp;amp; Denoise&amp;quot;, uses the functions of the Noise Reduction module in the main-menu Detail tab adapted to increase the number of wavelet decompositions. The same applies to the Retinex functions etc. Some modules do however have different code e.g. Color &amp;amp; Light.&lt;br /&gt;
* Many of the tools in Local Adjustments are similar to those in the other main-menu tabs but with additional functions, such as: &lt;br /&gt;
** Tone Equalizer or Tone Response Curve (TRC) with Shadows/Highlights, which allows fine and differentiated exposure adjustment. &lt;br /&gt;
** Original Retinex, which can be used to simulate a &amp;quot;dodge and burn&amp;quot; function.&lt;br /&gt;
** Log Encoding, which is a form of tone-mapping using simple logarithmic encoding.&lt;br /&gt;
** Warm/Cool (Vibrance &amp;amp; Warm/Cool) which allows the user to simulate color temperature changes similar to White Balance. &lt;br /&gt;
** Blur/Grain (Blur/Grain &amp;amp; Denoise) allows local blur, grain or noise to be added to the image. &lt;br /&gt;
** JzCzHz and CAM16 with Sigmoid and other advanced functions such as Color Appearance (Cam16 &amp;amp; JzCzHz) to prepare the way for future HDR functions. &lt;br /&gt;
** Wavelets with many new tools (tone mapping, decompression, clarity, etc.).&lt;br /&gt;
&lt;br /&gt;
===Overview of the RT-spot area===&lt;br /&gt;
When the user selects an RT-spot, the image on the screen shows: &lt;br /&gt;
* A center C consisting of an adjustable circle whose size (diameter) and position can be varied using the mouse or cursors. &lt;br /&gt;
* Four horizontal and vertical delimiting points T (top), B (bottom), L (left), R (right) whose positions can be varied with the mouse or cursors.&lt;br /&gt;
This gives: &lt;br /&gt;
* An area (either an ellipse or rectangle) bounded by 4 delimiting points T, B, L, R. The various algorithms (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Retinex, Shadow/Highlight &amp;amp; Tone Equalizer, etc.) operate within this area. It is also where the color-detection and structure-detection algorithms are calculated and applied (except of course in Inverse mode). &lt;br /&gt;
* The orientation of the RT-spot cannot be varied. This may be possible in the future but it would add considerably to the complexity of the algorithms and a significant amount of work to adapt the GUI.&lt;br /&gt;
It is possible to extend the boundaries of the above areas outside the preview area. This is done automatically when the user selects full-image mode. &lt;br /&gt;
Note that masks (with 1 or 2 Spots) can be used to compensate for the fact that the RT-Spots cannot be rotated. They also allow the user to further refine the processing, depending on the requirements.&lt;br /&gt;
===The 3 types of gradient===&lt;br /&gt;
The RT-spot object is based on 3 types of gradient: &lt;br /&gt;
* Dissymetry: a natural gradient inside the area bounded by the RT-spot can be created by placing the four points TBLR dissymetrically around the center C. &lt;br /&gt;
* Transition: this is an adjustable gradient that operates from the center C to the periphery of the spot.&lt;br /&gt;
* Color (deltaE): the Scope slider adjusts the extent of any applied adjustments as a function of deltaE (ΔE). Lower values limit the color deviations (L, C, H) that will be taken into account whereas higher values (Scope = 80 and above) will allow the tool to act on a wider range of values. When the Scope value reaches 100 there is no longer any differentiation and all colors will be adjusted equally.&lt;br /&gt;
The three types of gradient described can be used in conjunction with any of the tools (including Contrast By Detail Levels, Retinex, Tone Mapping, etc.), many of which also have their own graduated filter function. In all cases the center C of the RT-spot is the reference point for the start of the gradient.&lt;br /&gt;
===The 4 types of RT-spot===&lt;br /&gt;
Four types of RT-spot are available: &lt;br /&gt;
* Normal: each new spot takes into account any adjustments that may previously have been applied by other spots to the same image area. The action is recursive, rather like overlapping layers in a bit-map editor. &lt;br /&gt;
* Excluding: can be used to cancel the action of a Normal spot by resetting the selected part of the image to whatever state it was in prior to applying any previous spots. It uses the previous adjustment data to reverse the effect. It can also be used to invert the behavior of certain tools. &lt;br /&gt;
** In principle it is similar to the Capture NX2© “counter point”. It allows the user to correct changes that have strayed into unwanted areas or to prevent certain parts of the image being affected. For example if the user wants to increase the saturation of a portrait without affecting the eyes or some other part of the image, which has been exposed differently.&lt;br /&gt;
** The algorithm used for the Excluding spot is similar to those used elsewhere in Local Adjustments. It is based on differences in ΔE and on the image structure (using a Sobel Canny transform). It is not perfect, but should satisfy 70% of the cases.&lt;br /&gt;
** How to use an Excluding spot&lt;br /&gt;
*** Simply place the new spot on the area to be excluded. &lt;br /&gt;
*** Choose “Excluding spot” in the Settings &amp;gt; “Spot method” menu. &lt;br /&gt;
*** Then set Scope, Transition Gradient, &amp;quot;Spot size&amp;quot; and the 4 area limiters to obtain the desired effect. If necessary, you can further refine the adjustments by adding a tool such as Color &amp;amp; Light (as for a normal spot). &lt;br /&gt;
*** In some cases (when there is only a small difference in ΔE) it may be necessary to reduce the &amp;quot;ΔE scope threshold&amp;quot; slider with respect to its default value.&lt;br /&gt;
** How to use an excluding spot to simulate an “inverse” mode&lt;br /&gt;
*** Some (but not all) of the tool modules contain an Inverse mode. This basically allows you to apply the adjustment outside the RT-spot area instead of applying it inside. For example, if you use a spot to lighten the area inside the spot and then tick the Inverse box, it will lighten everything outside the spot and leave the area inside the spot untouched.&lt;br /&gt;
*** This effect can also be achieved using an Excluding spot. The advantage is that it works with all of the tools and is not restricted to those with a built-in Inverse mode.The procedure is simple:&lt;br /&gt;
**** Create an Rt-spot that extends the TBLR points beyond the limits of the image either by using the Full-image option, or by using a Normal spot and extending the points manually.&lt;br /&gt;
**** Taking the Inverse mode example above, lighten the area inside the spot. Because the spot boundaries extend beyond the image boundaries, the whole image will be lightened.&lt;br /&gt;
**** Now place an Excluding spot over the area where you want to cancel out the modifications carried out in the previous step. Adjust the Scope if necessary.&lt;br /&gt;
**** The result is almost the same as the first example above using Inverse mode.There two things to note however when using this method:&lt;br /&gt;
***** The way the algorithm works for the Excluding spot means that the result will not be exactly the same as if the Inverse mode in the tool had been used (when available). This is because the transition zones are different.&lt;br /&gt;
***** The use of the Excluding spot (as opposed to using Inverse mode) also means that the area it covers will be reset to the original image data and any adjustments carried out in that area prior to applying the Excluding spot will be lost.&lt;br /&gt;
** When there are uniform areas in the image, the &amp;quot;Spot structure&amp;quot; slider (when available in the particular tool being used) can help restrict the effect.&lt;br /&gt;
* Full image &lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee, with the added advantage of being able to use the ΔE function for more precise adjustments. If you don't want to use the ΔE function then you can effectively disable it by setting the tool Scope to 100 and it will behave in the same way as any other of the RawTherapee tools in the main menu used to work on the global image. &lt;br /&gt;
** The RT-spot is a rectangle with the delimiters automatically placed well beyond the image boundaries. These can be moved around depending on the desired effect. &lt;br /&gt;
** The “Transition value” is set to 100. This can also be changed, especially if you want to create gradients. &lt;br /&gt;
** The use of ΔE means that the image rendering will depend on the position of the center of the RT-spot (in the same way as Normal and Excluding spots). The position of the center of the Rt-spot and its size determine the basic parameters for calculating ΔE. &lt;br /&gt;
** Please note that some tools may have high memory requirements (superior to 8 or even 16 Mb) in full-image mode, especially with very large images. Examples include the denoise function in Blur/Grain &amp;amp; Denoise, the wavelet function in Local contrast &amp;amp; Wavelets or the retinex function in Dehaze &amp;amp; Retinex. The use of FFTW may also increase the processing time.&lt;br /&gt;
* Global&lt;br /&gt;
** Allows you to work on the whole image similar to the rest of RawTherapee (except masks).&lt;br /&gt;
** But it cancels out the notion of deltaE and transition. In this mode, the overall behavior is similar to that of Rawtherapee's other tools.&lt;br /&gt;
** Some tools, such as the “Graduated filter”, are guided by the position of the RT-spot center.&lt;br /&gt;
** When you choose a “Global” RT-spot, all the tools you open will operate in this mode.&lt;br /&gt;
** You can open several other RT-spots, in the mode of your choice, to adapt the image locally. Either with “Normal spot”, or with “Excluding spot” to undo a change made in Global mode, or with “Full image”.&lt;br /&gt;
&lt;br /&gt;
* In Preferences &amp;gt; General &amp;gt; Define Spot method for Local Adjustments, you can choose the default mode you prefer.&lt;br /&gt;
&lt;br /&gt;
===The three levels of complexity===&lt;br /&gt;
Each tool (Color &amp;amp; Light, Tone mapping, etc.), has a complexity level selector with 3 possible options: Basic, Standard, Advanced &lt;br /&gt;
* Basic is the default mode, which should be sufficient for the vast majority of local editing requirements. It has no masks and few curves. &lt;br /&gt;
* The Standard mode has been enhanced with additional functions and settings including graduated filters, curves and simplified masks. &lt;br /&gt;
* Advanced mode contains advanced functions for experienced users wishing to have maximum control over the various algorithms. Some examples of additional functionality include: &lt;br /&gt;
** A &amp;quot;Merge file&amp;quot; module in Color &amp;amp; Light that allows users to use blend modes (Difference, Multiply, Soft Light, Overlay, etc) to blend Rt-spots similar to the way layers can be blended in Gimp or Photoshop. &lt;br /&gt;
** Masks with additional functions such as a Structure Mask, a Blur Mask, etc.&lt;br /&gt;
It should be noted that there are effectively only two options for Dehaze &amp;amp; Retinex, Basic and Advanced (the Basic and Standard options are identical). Modifying the GUI to reflect this seems to be difficult at this stage.&lt;br /&gt;
===Hue, chroma, luminance references and the principle of the algorithm===&lt;br /&gt;
The powerful shape detection algorithm is based on the following: &lt;br /&gt;
* The area of the central circle C serves as a reference. Depending on the diameter chosen by the user, the system calculates the average of the hue, chroma and luminance (when using Denoise, the values are blurred slightly prior to processing to reduce the impact of noise). &lt;br /&gt;
* The choice of the diameter of the central zone depends on the use. For foliage for example, the user should choose a low value in order to select only the green color of the foliage. Conversely, for skin the user should increase the diameter in order to avoid taking into account spurious data (noise, eyelashes, etc.). &lt;br /&gt;
* The RT-spot area is divided into four quadrants. In each of these quadrants (of the ellipse or rectangle) the algorithm proceeds as follows:&lt;br /&gt;
** Calculates the ΔE (perceived difference between 2 colors taking into account hue, chroma and luminance) between the central zone and the current pixel. &lt;br /&gt;
** Attenuates the intensity of the adjustment based on the above ΔE value using either a linear or a power law (parabolic, cubic, etc.) depending on the setting of &amp;quot;ΔE decay&amp;quot; in Settings (1 = linear law, 2 = parabolic, etc.).&lt;br /&gt;
The extent of this action depends on the setting of the Scope slider.&lt;br /&gt;
This allows the user to differentiate the action according to the criteria mentioned above. For example, if the central circle is placed on some foliage, the action can be limited to just the foliage contained in the area covered by the RT-spot, without affecting the background e.g. the sky (impossible with a lasso).&lt;br /&gt;
* The “Transition value” slider allows the user to vary the action inside the RT-spot area. If the slider is set to 50, then the full adjustment will be applied to half of the area (working outwards from the center C). The adjustment is then attenuated progressively until the limits of the spot boundary are reached. The fall-off is by default linear but the user can modify this to use a non-linear power function using the “Transition decay (linear-log)” slider.&lt;br /&gt;
* If you increase the value of Scope the whole area contained within the RT-spot will be gradually taken into account whatever the hue, chroma or luminance. &lt;br /&gt;
* If we reduce the value of Scope, the action will be limited to those pixels close (in terms of ΔE) to the pixels in the reference area (the circle C). &lt;br /&gt;
* If the Scope is greater than 80, ΔE will have progressively less effect and will cease to be taken into account when Scope = 100. Using the Scope slider between 80 and 100 is not generally recommended except for specific applications e.g. creating luminance gradients or disabling the ΔE detection in full-image mode.&lt;br /&gt;
The shape detection algorithm is designed primarily for use in Normal mode. It can be used in Inverse mode but with some restrictions. For example in the Color &amp;amp; Light tool:&lt;br /&gt;
# There is no color correction grid.&lt;br /&gt;
# There are fewer curves.&lt;br /&gt;
# “Merge file” is not possible.&lt;br /&gt;
&lt;br /&gt;
====Recursive updating of references====&lt;br /&gt;
If you enable the &amp;quot;Recursive references&amp;quot; checkbox under the “Specific cases” drop-down menu: &lt;br /&gt;
* The hue, chroma, luma and Sobel references will be dynamically updated for each module used for the same RT-spot, and for each RT-spot. &lt;br /&gt;
* The references that appear in the C(C), L(L) and LC(h) masks and h(H) will also be update.&lt;br /&gt;
====Preview of selected areas (Preview ΔE)====&lt;br /&gt;
If you select the Preview ΔE button in Settings, you will get a preview of the areas of the image that have been affected by the selection (the effects of any transition gradients are not taken into account). &lt;br /&gt;
The &amp;quot;ΔE preview color - intensity&amp;quot; button in Settings allows you to select either a green or blue preview color and adjust its intensity.&lt;br /&gt;
Only luminance adjustments are visible in the ΔE preview. The preview will not show the effect of any sliders or curves that affect color. &lt;br /&gt;
Scope is the most sensitive setting since it acts directly on ΔE. Please note that the Scope setting located in Settings is only applicable to the Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, and Vibrance &amp;amp; Warm/Cool tools. All other tools have their own Scope slider. &lt;br /&gt;
The effects of the 4 sliders located in Settings i.e: “ΔE scope threshold”, “ΔE decay”, “ab-L balance (ΔE)” and “C-H balance (ΔE)” are also visible in the preview.&lt;br /&gt;
&lt;br /&gt;
===Summary of the different options in Settings===&lt;br /&gt;
Settings includes everything that is common to RT-spot management, for example: &lt;br /&gt;
* The transitions will be identical whichever tool is selected (Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Bur/Grain &amp;amp; Denoise, etc.) &lt;br /&gt;
* Anything that is specific to a particular tool is handled in the tool module itself. For example the management of ΔE (Scope) for tools other than Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer and Vibrance &amp;amp; Warm/Cool.&lt;br /&gt;
====RT-spot management====&lt;br /&gt;
The first set of parameters in the Local Adjustments interface provide the following options for managing spots:&lt;br /&gt;
* Add &lt;br /&gt;
* Delete&lt;br /&gt;
* Duplicate (creates a new spot with the same shape characteristics as the previous spot)&lt;br /&gt;
* Rename (allows the user to customize spot names)&lt;br /&gt;
* Show/Hide (hide or show the selected spot depending on whether you are previewing or editing the image)&lt;br /&gt;
====RT-spot shape====&lt;br /&gt;
Activate the menu options by ticking the checkbox “Show additional settings”. The drop-down menu “RT-spot shape” allows you to select either an ellipse or a rectangle for the Rt-spot shape. Ellipse is the default mode.&lt;br /&gt;
====Spot method====&lt;br /&gt;
The “Spot method” drop-down menu allows you to choose between a “Normal spot” an “Excluding spot” or a “Full-image” spot. The default is a “Normal spot”. Any of the available tools in the drop-down tool list “Add tool to current spot” can be used in any of the spots.&lt;br /&gt;
====Spot size====&lt;br /&gt;
The default size should be suitable in most cases. Smaller values can be used in conjunction with the Scope slider to select just the leaves of a tree for example. Larger values will make the calculation of the reference values (hue, chroma, luma) less sensitive to small variations. This can be useful when processing skin.&lt;br /&gt;
====Transition Gradient====&lt;br /&gt;
It can be adjusted with three sliders as follows: &lt;br /&gt;
* &amp;quot;Transition value”: allows you to chose the extent of the action inside the RT-spot. For a selected value &amp;quot;x&amp;quot;, the algorithm is applied 100% from the center to x% of the selected area. It then decays to 0 at the periphery of the spot. With this transition we end up with 3 zones (note that in Inverse mode, these zones are reversed). &lt;br /&gt;
** zone 0: located outside the selection encompassed by the RT-spot (rectangle or ellipse). The algorithm has no effect. &lt;br /&gt;
** zone 1: the zone located inside the RT-spot where the action of the transition cursors is taken into account. The algorithm is applied degressively. &lt;br /&gt;
** zone 2: the zone located close to the center C, where the action of the transition cursors is not taken into account. The algorithm is applied 100%.&lt;br /&gt;
Note: very small values can be used to help reduce defects.&lt;br /&gt;
* &amp;quot;Transition decay (linear - log)&amp;quot;: adjusts the transition decay as a function of distance: 1 = linear, 2 = parabolic, 3 to 10 = cubic (max. exponent value =25) for very heavy decay. This makes it possible to choose a relatively large Rt-spot to correct certain defects without the risk of the spilling over into unwanted parts of the image. &lt;br /&gt;
* &amp;quot;Transition differentiation XY&amp;quot;: for all values other than zero, the slider creates a differential gradient between the abscissa and the ordinate. Negative values reduce the transition area on the ordinate and positive values increase it. &lt;br /&gt;
* &amp;quot;Feather gradient (Grad. Filters)”: this is a common slider which works in conjunction with the graduated filters when they have been activated in individual tools. The gradient width is a percentage of the spot diagonal.&lt;br /&gt;
====Shape detection====&lt;br /&gt;
* &amp;quot;ΔE decay”: adjusts the fall-off in intensity as a function of ΔE using a power function (1 = linear up to 10 for very high decay). The higher values are designed to be used for images with a very wide gamut. &lt;br /&gt;
* &amp;quot;ΔE scope threshold&amp;quot;: allows you to fine tune the ΔE values to reduce or increase the sensitivity of the Scope slider. Higher values are designed to be used with high-gamut images (flowers, artificial colors, etc.). &lt;br /&gt;
* &amp;quot;ab-L balance (ΔE)&amp;quot;: determines the weighting of the three components L* a* b* when determining the value of ΔE. A slider value =1 means that they have equal weighting. Higher values will increase the weight of L* and lower values will increase the weight of the color components. &lt;br /&gt;
* &amp;quot;C-H balance (ΔE)&amp;quot;: with a slider value = 1, the ΔE calculation applies equal weighting to the chromaticity and hue components. Higher values will increase the action of H (hue) and vice versa. &lt;br /&gt;
* &amp;quot; ΔE preview color - intensity&amp;quot;: this allows you to change the color of the “Preview ΔE ” function. The default the color is green. Moving the slider to the left will change the color to blue. Pushing the slider to the extremes will increase the intensity of either the blue or green color.&lt;br /&gt;
====Avoid Color Shift====&lt;br /&gt;
Tries to put the colors back into the working-profile gamut prior to carrying out a Munsell correction. In most cases, it is recommended to select &amp;quot;Avoid color shift&amp;quot;, in conjunction with &amp;quot;Munsell correction only&amp;quot;. This ensures that the L*a*b* processing will stay neutral in terms of hue when changing the saturation, and avoids the gamut control which can cause artifacts in overexposed images. &lt;br /&gt;
====All changes forced in black and white====&lt;br /&gt;
When the user has used a black and white module or a black and white film simulation prior to applying any local adjustments, this check box will ensure that color will not reappear when local adjustment settings are applied.&lt;br /&gt;
====Recursive references====&lt;br /&gt;
Forces the algorithm to recalculate the ΔE references in the center C after each tool has been applied. &lt;br /&gt;
====Shape method====&lt;br /&gt;
You can choose the way the RT-spot shape is manipulated from among the following options: &lt;br /&gt;
* Independent (mouse) - default setting &lt;br /&gt;
* Symmetrical (mouse) &lt;br /&gt;
* Independent (mouse + cursors) &lt;br /&gt;
* Symmetrical (mouse + cursors)&lt;br /&gt;
==== Wavelet Edge performance====&lt;br /&gt;
An image that has been decomposed into its components by the Daubechies method can have up to 10 scales of coefficients ranging from D2 (which corresponds to the Haar decomposition) to D20. In RawTherapee the coefficients D2 (low), D4 (standard), D6 (standard plus), D10 (medium) and D14 (high) are used. The more coefficients there are, the more detail the wavelet decomposition will distinguish, albeit with a slight increase in processing time (often negligible). &lt;br /&gt;
Although there is no direct relationship between the resulting quality and the number of coefficients (depending on the original image), choosing the right number of coefficients will help refine the quality of the lower levels and the residual image: &lt;br /&gt;
* In some cases, the best results for edge detection are obtained with D2 &lt;br /&gt;
* In other cases better results can be obtained with D6 or D14&lt;br /&gt;
====Mask and Merge====&lt;br /&gt;
Used by masks - LC(h) curves etc. - when enabled (Standard and Advanced modes only).&lt;br /&gt;
* Enable “ΔE Image mask” in the check box. For all masks: &lt;br /&gt;
** Takes into account the ΔE of the image to avoid modifying the selection area when the following mask tools are used: Gamma, Slope, Chroma, Contrast Curve, Local Contrast (by wavelet level), Blur Mask and Structure Mask (if enabled). &lt;br /&gt;
** Disabled when Inverse mode is used.&lt;br /&gt;
* Scope (ΔE Image mask): allows ΔE to be taken into account when creating masks. This setting improves mask selection without affecting the various Scope tools. It assumes that one of the mask tools is activated (e.g. chroma mask, contrast curve mask, gamma mask, slope mask etc.).&lt;br /&gt;
* Denoise chroma mask: allows the user to control the chromatic noise of the mask. Useful for a better control of the chrominance noise and to avoid artefacts, especially when using the LC(h) curve. &lt;br /&gt;
* Background color/luma mask: adjusts the shade of gray or color of the mask background in &amp;quot;Show mask&amp;quot; (in the &amp;quot;Mask and modifications&amp;quot; menu in individual tools).&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Soft radius===&lt;br /&gt;
This feature can be used to soften the agressive action that can sometimes occur when using the following algorithms (with the exception of Basic mode):&lt;br /&gt;
* Color &amp;amp; Light&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure&lt;br /&gt;
* Contrast By Detail Levels&lt;br /&gt;
&lt;br /&gt;
The result is softened by using a guided filter on the differences in luminance between the original and the modified images.&lt;br /&gt;
&lt;br /&gt;
Note: This algorithm is also an integral part of the Shadows/Highlights &amp;amp; Tone Equalizer design.&lt;br /&gt;
&lt;br /&gt;
Currently only the luminance component is processed but there is nothing to prevent future versions taking the color components into account using either Chroma (C *) or the 2 components a * and b *&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Graduated Filter===&lt;br /&gt;
&lt;br /&gt;
Based on the Graduated Filter tool used in the Exposure tab (luminance gradient), this tool adds two additional gradients:&lt;br /&gt;
* Chrominance: allows you to vary the chrominance and produce chroma gradients (e.g. in the sky or in portraits).&lt;br /&gt;
* Hue: allows you to produce color gradients by varying the hue (landscapes, fine adjustments, special effects etc.).&lt;br /&gt;
Example using a Graduated Filter to produce variations in luminance, chrominance and hue: [[Local_Adjustments#Making_a_graduated_filter_based_on_luminance.2C_chrominance_and_hue_.28gradient_filter.29 | Example in Getting started - Graduated Filter based on Luminance Chrominance and Hue]]&lt;br /&gt;
The following tools include a graduated filter module:&lt;br /&gt;
* Color &amp;amp; Light: luminance, chrominance and hue&lt;br /&gt;
* Dynamic Range &amp;amp; Exposure: luminance&lt;br /&gt;
* Shadows/Highlights &amp;amp; Tone Equalizer: luminance&lt;br /&gt;
* Vibrance &amp;amp; Warm/Cool: luminance, chrominance, hue&lt;br /&gt;
* Local Contrast &amp;amp; Wavelets: wavelet-based local contrast only&lt;br /&gt;
&lt;br /&gt;
The feather slider, which controls the gradient fall-off in the RT-spot area, can be found in Settings &amp;gt; Transition Gradient.&lt;br /&gt;
&lt;br /&gt;
The gradient can only be rotated using the &amp;quot;Gradient angle&amp;quot; slider at this stage. There is no mouse assistance.&lt;br /&gt;
&lt;br /&gt;
Applying a gradient does not affect the Transition or Scope settings.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm – &amp;quot;Merge file&amp;quot;===&lt;br /&gt;
Example using the merge-file function (Color &amp;amp; Light):[[Local_Adjustments#Merging_layers_using_blend_modes | Example in Getting Started Merge File]]&lt;br /&gt;
In Color &amp;amp; light there are 4 options in the &amp;quot;Merge file&amp;quot; drop-down menu:&lt;br /&gt;
* None: All of the usual Rawtherapee functions, including masks, operate normally.&lt;br /&gt;
* Original Image: Blends the current image as shown on the screen with the original unmodified image.&lt;br /&gt;
* Previous Spot: Blends the current image with the previous spot.&lt;br /&gt;
* Background: Allows the user to choose an image background and vary its hue, chroma and luminance.&lt;br /&gt;
&lt;br /&gt;
====Using the Background option to simulate a brush====&lt;br /&gt;
Choose: &lt;br /&gt;
* A small Rt-spot size, &lt;br /&gt;
* A very low &amp;quot;Transition value&amp;quot; setting, &lt;br /&gt;
* A high &amp;quot;Transition decay&amp;quot; setting,&lt;br /&gt;
* Then duplicate the spot.&lt;br /&gt;
&lt;br /&gt;
====Several types of merge are possible with or without a mask====&lt;br /&gt;
&lt;br /&gt;
The scope and transition functions remain unaltered. &lt;br /&gt;
&lt;br /&gt;
Merge modes – similar to blend modes in Photoshop © and the GIMP:&lt;br /&gt;
* Normal, Subtract, Difference, Multiply, Addition, Divide, Soft Light (legacy), Soft Light Illusion, Soft Light W3C, Hard Light, Overlay, Screen, Darken Only, Lighten Only, Exclusion, Hue, Saturation, Color, Luminosity.&lt;br /&gt;
* The amount of blend can be adjusted with the Opacity slider. &lt;br /&gt;
* Merge background (deltaE): takes into account deltaE when blending (a sort of equivalent to Scope)&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Merge file&amp;quot; example====&lt;br /&gt;
The following example is an illustration of one of the many possible applications of &amp;quot;Merge file&amp;quot;.&lt;br /&gt;
We are going to create a variable gradient on a blurred background.&lt;br /&gt;
&lt;br /&gt;
* Add the first RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse.&lt;br /&gt;
** Check the Inverse checkbox.&lt;br /&gt;
** Select the area to be excluded from the blurring function by using the 4 spot delimiters.&lt;br /&gt;
** Select: Blur/Grain &amp;amp; Denoise &amp;gt; Blur &amp;amp; Noise &amp;gt; &amp;quot;Gaussian Blur - Noise – Grain&amp;quot;. &lt;br /&gt;
** Set the Radius to a value between 1000 and 10000 (uses a Fourier FFTW function).&lt;br /&gt;
** Select Noise if you wish to add some luminance noise. &lt;br /&gt;
&lt;br /&gt;
* Add a second RT-spot set to: &amp;quot;Normal spot&amp;quot;, Ellipse, &amp;quot;Transition value&amp;quot; = 60 (you can change these settings later if you wish).&lt;br /&gt;
** Put the center of this new RT-spot inside the first spot (in the unblurred area).&lt;br /&gt;
** Using the four delimiters, select the area where you want to vary the blur. This will be outside the area of the first spot. Note that if you extend the 4 delimiters beyond the image boundaries then you will only be able to produce a simple gradient. &lt;br /&gt;
** Activate the Color &amp;amp; Light tool and set to Advanced mode.&lt;br /&gt;
** Set the Scope to a high value (at or near 100).&lt;br /&gt;
** In &amp;quot;Merge file&amp;quot;, select Original Image.&lt;br /&gt;
** In &amp;quot;Merge with Original/Previous/Background&amp;quot; select the Normal blend mode (you can also experiment with other blend modes such as Soft Light if you wish). &lt;br /&gt;
*** Set &amp;quot;Merge background (deltaE)&amp;quot; to around 50 depending on the desired effect.&lt;br /&gt;
*** Set the Opacity to around 50 to adjust the effect.&lt;br /&gt;
*** Adjust the Contrast Threshold depending on taste.&lt;br /&gt;
&lt;br /&gt;
[[File:doubleblur.jpg|300px|thumb|center|Doubleblur]]&lt;br /&gt;
&lt;br /&gt;
===The RT-spot and layers===&lt;br /&gt;
Each new RT-spot is made up of two &amp;quot;layers&amp;quot;. The first layer contains the original unmodified image data in case the user wishes to use the &amp;quot;Merge file&amp;quot; blend modes with the original image or use the spot in Excluding mode. The second layer contains a copy of the previous image information including all edits, even if the actual spot size is smaller than the image itself. &lt;br /&gt;
This allows the user to apply the blend modes described above to either the previous image or to the original image. &lt;br /&gt;
&lt;br /&gt;
The merge or blend modes are sensitive to the individual RT-spot settings and in some cases will only work if the Scope has been set to 100. &lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Recovery based on luminance mask===&lt;br /&gt;
Certain tools such as Color &amp;amp; Light, Shadows/Highlights &amp;amp; Tone Equalizer, etc., include an algorithm that allows the user to modulate the effect of the masking curves L(L) or LC(H) in &amp;quot;Mask and modifications&amp;quot; and is based on the luminance values. The two threshold sliders, Light and Dark, set the range of luminance values beyond which the parameters of the current tool will gradually diminish until they no longer have any effect. Between the two thresholds, the parameters of the current tool operate normally.&lt;br /&gt;
&lt;br /&gt;
The mask and at least one of the curves must be activated for this function to work.&lt;br /&gt;
&lt;br /&gt;
===Complementary algorithm - Mask and Modifications=== &lt;br /&gt;
Example using a mask: [[Local_Adjustments#Using_a_simple_mask_to_improve_color_selection | Example in Getting started to improve color selection]]&lt;br /&gt;
&lt;br /&gt;
====Preamble====&lt;br /&gt;
The mask concepts used in Local Adjustments have been designed by Jacques Desmis based on the three L, C, H masks used in &amp;quot;Color Toning &amp;gt; Color correction regions&amp;quot; in the main-menu Color tab. &lt;br /&gt;
There are however some significant differences which may surprise users used to masks in other software. They also have some limitations due to the current GUI implementation in Local Adjustments i.e. they cannot be tilted or modified using Bezier curves or polygons. &lt;br /&gt;
Some tools do however have functions generally not available elsewhere (in Advanced mode): &lt;br /&gt;
** Structure Mask, which allows the image structure to be used either on its own or in combination with other mask functions. This allows the user to reinforce the differentiation between light and dark areas. &lt;br /&gt;
** Blur Mask, which varies the contrasts of the mask again allowing the user to accentuate the difference between light and dark areas.&lt;br /&gt;
** &amp;quot;Wavelet level selection&amp;quot;, which modifies the mask as a function of the maximum and minimum wavelet levels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Masks are only available in Standard or Advanced mode for the tools concerned.&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Masks are available for the following 11 modules: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/cool, Log encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Local Contrast &amp;amp; Wavelets&amp;quot;, Tone mapping, Dehaze &amp;amp; Retinex, Blur/Grain &amp;amp; Denoise (these two modules have a common mask). &lt;br /&gt;
*The three tools Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure and Shadows/Highlights &amp;amp; Tone Equalizer can be used in Inverse mode (with certain restrictions).&lt;br /&gt;
*The Blur/Grain and the Denoise tools have a common mask.&lt;br /&gt;
*In the case of Tone Mapping and Dehaze &amp;amp; Retinex, the mask can be applied either before or after adjustments carried out in the current tool are applied.&lt;br /&gt;
&lt;br /&gt;
You can adjust the background luminance of the masks in Settings. The scale ranges from 0 to 30 and is set to a value of 10 by default. Reducing the value improves the visibility of the modifications but reduces the visible detail of the image and vice versa. &lt;br /&gt;
&lt;br /&gt;
====Mask and modifications====&lt;br /&gt;
The drop-down menu has several options, which vary depending on the tool being used. &lt;br /&gt;
* Show modified image: shows the modified image including the effect of any adjustments and masks. &lt;br /&gt;
* Show modifed areas without mask: shows the modifications before any masks are applied. Shows the effect of the transition settings. &lt;br /&gt;
* Show modified areas with mask: shows the modifications after the mask or masks have been applied. Shows the effect of the transition settings.&lt;br /&gt;
* Show mask: shows the aspect of the mask including any curves or filters. It does not show any transitions or the ΔE itself. However, if &amp;quot;ΔE Image mask&amp;quot; has been checked in Settings (Mask &amp;amp; Merge), Show Mask will show any modifications made to the mask by any of the following mask tools: Gamma, Slope, Contrast Curve, Local Contrast (by wavelet level), Blur mask and Structure mask. The scope of these tools can be fine tuned using the &amp;quot;Scope (Δ Image mask)&amp;quot; slider. &lt;br /&gt;
* &amp;quot;Show Spot structure (Advanced) &amp;quot;: allows you to see the effect of the &amp;quot;Spot structure&amp;quot; slider when available. &lt;br /&gt;
* Preview ΔE: allows you to see the image and the ΔE no matter which tool is being used. &lt;br /&gt;
&lt;br /&gt;
====These masks have two main objectives:====&lt;br /&gt;
#Increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image. This is useful in the rare cases when the ΔE algorithm alone is insufficient. &lt;br /&gt;
#Create special effects by combining the image used for the mask with the original image.&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
=====LCH Curves=====&lt;br /&gt;
The curves included in certain tools generate masks which modify the image before the actual tool adjustments are applied, except in the case of Tone Mapping and the Retinex function in Dehaze &amp;amp; Retinex, where the masks can be applied either before or after the tool adjustments. These masks and any modifications that have been made to them using the mask tools, take into account the Local Adjustments shape-detection and transition algorithms etc., irrespective of where they are applied in the processing pipleline. Of course the overall result will differ depending on where they are positioned. Curves are available in the following tools: Color &amp;amp; Light, Dynamic Range &amp;amp; Exposure, Shadows/Highlights &amp;amp; Tone Equalizer, Vibrance &amp;amp; Warm/Cool, Log Encoding, Color Appearance (Cam16 &amp;amp; JzCzHz), Contrast by Detail Levels, Tone Mapping, Blur/Grain &amp;amp; Denoise and Local Contrast &amp;amp; Wavelets.&lt;br /&gt;
There are three curves all set to 1 (maximum) at startup:&lt;br /&gt;
* C=f(C): chrominance varies as a function of chrominance. The user can reduce the chrominance to improve the selection. &lt;br /&gt;
* L=f(L): luminance varies as a function of luminance. The user can reduce the luminance to improve the selectivity.&lt;br /&gt;
* L and C = f(H): the luminance and the chrominance can be varied as a function of hue. The user can reduce both the luminosity and the chroma to improve the selection. &lt;br /&gt;
If the user positions the curves near the zero point on the y-axis, the effect of the mask will be inverted. &lt;br /&gt;
&lt;br /&gt;
=====Structure Mask=====&lt;br /&gt;
A mask based on the image structure to differentiate low-contrast areas (uniform areas such as skies etc.) from high-contrast areas (buildings, hilly terrain etc.). It can be used in two ways: &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength » slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; unchecked:&lt;br /&gt;
In this case, a mask showing the structure will be generated even if none of the 3 curves have been activated. Take it easy when you use this slider! &lt;br /&gt;
* Structure Mask (&amp;quot;Structure mask strength&amp;quot; slider) with the checkbox &amp;quot;Structure mask as tool&amp;quot; checked:&lt;br /&gt;
In this case a mask showing the structure will be generated after having activated the Mask curves L(L) or LC(h). In this case the structure mask behaves like the other mask tools such as Gamma, Slope etc. It allows you to differentiate the action based on the image structure. &lt;br /&gt;
* &amp;quot;Structure mask&amp;quot; is available for the Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light masks.&lt;br /&gt;
&lt;br /&gt;
=====Blur Mask=====&lt;br /&gt;
The Blur mask, which generates a large-radius blur, allows the user to vary the image contrast and lighten or darken selected parts of the image (using Color &amp;amp; Light). &lt;br /&gt;
* Contrast threshold: allows you to select the parts of the image that will be affected based on the texture. &lt;br /&gt;
* Radius: allows you to vary the radius of the Gaussian blur in the range 0 to 500. &lt;br /&gt;
* FFTW checkbox: uses a Fourier transform to improve the quality (increases processing time and memory requirements).&lt;br /&gt;
&lt;br /&gt;
Note that this checkbox is only available in Advanced mode. In other modes without FFTW, the radius is limited to 100.&lt;br /&gt;
&lt;br /&gt;
=====Smooth Radius et Laplacian Theshold=====&lt;br /&gt;
The simultaneous use of these two sliders is not recommended (the PDE equation cannot be solved). &lt;br /&gt;
======Smooth Radius======&lt;br /&gt;
The &amp;quot;Smooth radius&amp;quot; slider uses a guided filter to help reduce artifacts and transitions. &lt;br /&gt;
&lt;br /&gt;
======Laplacian Threshold======&lt;br /&gt;
Allows the user to increase the luminance in the highlights.&lt;br /&gt;
&lt;br /&gt;
=====Gamma, Slope, Chroma, Blend=====&lt;br /&gt;
You can modify the mask (producing the opposite effect on the image) with the following three sliders: &lt;br /&gt;
* Chroma: allows you to adapt the strength of the mask chroma as a function of the observed chroma in the image, which depends on several factors including the size of the workspace (sRGB, Prophoto, etc.). &lt;br /&gt;
* Gamma &amp;amp; Slope: Gamma and Slope are based on the same principle as sRGB gamma. The function acts on the Luminance L* channel with a linear part for the dark areas and a parabolic curve thereafter. The curve is continuous without any discontinuties. &lt;br /&gt;
&lt;br /&gt;
=====Blend=====&lt;br /&gt;
* Blend allows you to vary the extent to which the mask is blended with the current image.&lt;br /&gt;
&lt;br /&gt;
=====Contrast curve, Wavelet local contrast, Hue curve=====&lt;br /&gt;
* All masks have a &amp;quot;Contrast curve&amp;quot; function.&lt;br /&gt;
* Two masks (Blur/Grain &amp;amp; Denoise and Color &amp;amp; Light) are equipped with a wavelet-based local contrast function with wavelet level selection. &lt;br /&gt;
* Color and Light includes an H=f(H) function which allows the user to carry out fine color retouching, for example for skin. &lt;br /&gt;
=====Applications and use of the luminance and color masks=====&lt;br /&gt;
* Gamma and Slope: allow a smooth and artifact-free transformation of the mask by varying the luminance component L progressively avoiding discontinuities.&lt;br /&gt;
* Contrast curve: can be used similarly to Gamma and Slope, but in this case the action can be restricted to certain parts of the mask (usually the lightest parts) by using a curve to exclude the darker parts. &lt;br /&gt;
* Wavelet local contrast: allows you to decrease or increase the action on a particular level of detail of the mask as a function of the luminosity (usually the brightest areas). &lt;br /&gt;
* Hue curve: allows the user to fine tune the colors present in the mask. &lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;ΔE Image mask&amp;quot; Checkbox and &amp;quot;Scope (ΔE Image Mask)&amp;quot; in Settings=====&lt;br /&gt;
These two functions take into account the ΔE of the image to avoid modifying the selection area covered by the RT-spot: &lt;br /&gt;
* For each individual mask.&lt;br /&gt;
* For sliders and curves which modify the masks after they have been created: &lt;br /&gt;
** Sliders: Gamma, Chroma and Slope.&lt;br /&gt;
** Curves: &amp;quot;Contrast curve&amp;quot;, &amp;quot;Local contrast&amp;quot; by levels (when present), &amp;quot;Hue curve&amp;quot; (when present).&lt;br /&gt;
* Lower values of Slope increase the differentiation.&lt;br /&gt;
* The function is disabled in Inverse mode.&lt;br /&gt;
&lt;br /&gt;
====In practice====&lt;br /&gt;
To achieve the first objective mentioned above, i.e. ''increase the detection sensitivity to improve object selection and avoid modifying unwanted parts of the image'', it is important to avoid modifying the zone covered by the circle at the center of the RT-spot. This circle contains the reference values L, C &amp;amp; H, which can visualised on the graph itself in the form of a dark gray- light gray boundary. The user should therefore position the top of the curve on this boundary to avoid modifying the parameters inside the circle. &lt;br /&gt;
*Please note that if the option &amp;quot;Recursive references&amp;quot; has been selected (checkbox in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;) this can interfere with the position of the light-gray dark-gray boundary on the graph. It is therefore recommended to temporarily deactivate this option while you are adjusting the mask for the particular tool you happen to be working on e.g. if you are adjusting the &amp;quot;Exposure compensation&amp;quot; in the Dynamic Range &amp;amp; Exposure tool. &lt;br /&gt;
&lt;br /&gt;
*You can now adjust the mask to reduce the chroma or luma values depending on the required result. Reducing the y-axis value by 10% to 20% should be sufficient in the majority of cases as shown in the example below. &lt;br /&gt;
[[File:mask_sensi_obj1.jpg|600px|thumb|center|Increase the selection sensitivity]]&lt;br /&gt;
&lt;br /&gt;
*The Blend cursor should be left at zero when the objective is to increase detection sensitivity.&lt;br /&gt;
&lt;br /&gt;
As far as the second objective is concerned ''(create special effects by combining the image used for the mask with the original image)'', the approach depends on what you are trying to achieve. It is recommended that in the first instance you use the same method as above but with higher attenuation values (up to 100% if necessary). It should be noted that the mask in this case will also increase the selection sensitivity as for the first objective, but in this case the effect will be greater. The Blend slider is adjusted as follows: &lt;br /&gt;
*Negative slider values will subtract a complement of the mask image from the original image. In the case of a luminance mask, the image will become darker. &lt;br /&gt;
* Positive slider values will add a complement of the mask image to the original image. In the case of a luminance mask, the image will become lighter. &lt;br /&gt;
&lt;br /&gt;
There are several visual aids to help when adjusting the masks:&lt;br /&gt;
* a) Show mask&lt;br /&gt;
* b) Show modifications without the mask (except in Inverse mode).&lt;br /&gt;
* c) Show modifications with the mask (except in Inverse mode).&lt;br /&gt;
There is also an option to see the structure mask (except in Inverse mode). &lt;br /&gt;
Masks have to be generated individually (it is not possible to adjust several masks simultaneously), but once generated, they can be used together. &lt;br /&gt;
&lt;br /&gt;
You can change the visual appearance of the modifications with and without the mask in Settings &amp;gt; &amp;quot;Shape detection&amp;quot;. &lt;br /&gt;
* &amp;quot;ΔE preview color - intensity&amp;quot;&lt;br /&gt;
** Positive values of the cursor do not modify the color appearance. &lt;br /&gt;
** Negative values of the cursor add the L* a* b* &amp;quot;b&amp;quot; component to improve the visibility of changes in luminance. &lt;br /&gt;
&lt;br /&gt;
Note that masks can be memory intensive when there is a large selection area. &lt;br /&gt;
Note also that contrary to the usual image adjustments, any adjustments made to a mask will have the inverse effect on the image itself.&lt;br /&gt;
&lt;br /&gt;
====Using masks by themselves====&lt;br /&gt;
When a tool includes masking functions, these can be used without having to make any adjustments with the tool itself. For example:&lt;br /&gt;
* Log Encoding, which is the first tool before Denoise in the local-adjustments pipeline.&lt;br /&gt;
*Any module upstream of the current module (for example use the mask in Contrast by Detail Levels if the current module is Color &amp;amp; Light).&lt;br /&gt;
* Using the masks in this way (without using any of the tool sliders, curves etc.), allows you to modify the image (e.g. the gamma) at the beginning of the local-adjustments pipeline. &lt;br /&gt;
* Similarly &amp;quot;Color appearance (Cam16 &amp;amp; JzCzHz)&amp;quot;, which is the last module in the local-adjustments pipeline, can be used to modify the image after all the other local-adjustment modifications have been carried out. &lt;br /&gt;
&lt;br /&gt;
The masks in other modules (when equipped) can also be used with the exception of Retinex. &lt;br /&gt;
&lt;br /&gt;
====Using several masks====&lt;br /&gt;
When a tool with masking functions (e.g. Tone mapping, Dynamic Range &amp;amp; Exposure, etc.) is used in association with a given RT-spot, only one instance of the tool mask can be used with that particular spot. However it is simple to use additional masks if required.&lt;br /&gt;
&lt;br /&gt;
Note, the additional mask will take into account the results of the preceding mask. &lt;br /&gt;
&lt;br /&gt;
=====Using several masks with the same tool=====&lt;br /&gt;
To add a second mask to a given tool, you only have to activate another tool with masking (e.g. Contrast by Detail Levels), enable the mask and then adjust it. You don’t have to use the tool itself. &lt;br /&gt;
&lt;br /&gt;
The masks are applied in the same order as the tools in the local-adjustments pipeline. &lt;br /&gt;
&lt;br /&gt;
* In Advanced mode, you can make adjustments to the masks in Color &amp;amp; Light and Blur/Grain &amp;amp; Denoise based on local contrast (using wavelets), on the shadows and midtones (Shadows slider in Color &amp;amp; Light, Blur/Grain &amp;amp; Denoise) and on the highlights (Highlights slider in Blur/Grain &amp;amp; Denoise). &lt;br /&gt;
* The Color &amp;amp; Light mask mask has a hue curve (hue = f(hue)).&lt;br /&gt;
* The Vibrance &amp;amp; Warm/Cool mask is a special case because there is no effect on the luminance when using vibrance (apart from it being used for gamut control). The luminance response will therefore be negligeable. &lt;br /&gt;
&lt;br /&gt;
These features can be combined with &amp;quot;Merge file&amp;quot; and &amp;quot;ΔE Image mask&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====Use several masks with the same tool by duplicating the RT-spot=====&lt;br /&gt;
Duplicate the RT-spot and adjust its position and size.&lt;br /&gt;
This allows you to:&lt;br /&gt;
* Take into account different reference values (hue, chroma, luminance).&lt;br /&gt;
* Modify the affected area.&lt;br /&gt;
* Change the mask order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Retinex – a special case====&lt;br /&gt;
The Retinex module is similar to the other tools, however:&lt;br /&gt;
* You can only satisfy objective 1 in Normal mode (it doesn’t use the Transmission Map). &lt;br /&gt;
* If you select &amp;quot;Use transmission map&amp;quot; it does not behave as expected: &lt;br /&gt;
** Instead, the Retinex function will rely heavily on local contrast effects. Note that the function behaves the same for both positive and negative values of Blend. &lt;br /&gt;
** With &amp;quot;Use transmission map&amp;quot;, the light-gray dark-gray boundary indicating the reference hue, chroma and luminance values is completely erroneous. &lt;br /&gt;
&lt;br /&gt;
===Common Color Mask===&lt;br /&gt;
Example using a Common Color Mask:[[Local Lab controls/fr#How to use a Common Color Mask and Example merging 2 RT-Spots| Example in First Steps, Common Color Mask]]&lt;br /&gt;
&lt;br /&gt;
The tools in this mask have the same characteristics as the other masks mentioned above. &lt;br /&gt;
However the mask is based on different principles and the way it functions is different.&lt;br /&gt;
* The usual masks add additional functionality to the tool by either improving the selection or by changing the image aspect after it has been modified by the tool itself (e.g. Color &amp;amp; Light, Vibrance &amp;amp; Warm/Cool, etc.).&lt;br /&gt;
&lt;br /&gt;
In the case of the Common Color Mask, the mask behaves as if it were a tool in its own right:&lt;br /&gt;
* The three curves C(C), L(L), LC(H) and in Advanced mode, Structure Mask and Blur Mask, will generate color and structure differences with respect to the original image. &lt;br /&gt;
* This &amp;quot;difference&amp;quot; is of the same type as that generated by the Lightness or Chrominance functions in Color &amp;amp; Light.&lt;br /&gt;
&lt;br /&gt;
To make use of this particular mask behaviour, there are three additional common sliders:&lt;br /&gt;
* Scope: allows you to adjust the ΔE references depending on the position of the RT-spot and the parameters in Settings (all other Scope cursors are deactivated in this case).&lt;br /&gt;
* &amp;quot;Add/subtract luma mask&amp;quot;: allows you to add or subtract the luminance mask from the original image. &lt;br /&gt;
* &amp;quot;Add/subtract chroma mask&amp;quot;: allows you to add or subtract the chrominance mask from the original image.&lt;br /&gt;
** Both of these cursors are inactive when in the zero position. &lt;br /&gt;
* Scope acts on the differences generated by the two &amp;quot;add&amp;quot; and &amp;quot;subtract&amp;quot; cursors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Avoid color shift===&lt;br /&gt;
Available in Settings &amp;gt; &amp;quot;Specific cases&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has two functions:&lt;br /&gt;
* Ensures that the colors in the current working profile are within gamut using relative colorimetric.&lt;br /&gt;
* Adjusts the colors using Munsell correction when the L*a*b* saturation has been changed significantly, particularly for red-orange and blue-purple. &lt;br /&gt;
&lt;br /&gt;
Difficulties: &lt;br /&gt;
* There are no limits when using L*a*b* mode, which means that when a color is just within gamut in RGB, it can be transformed into an out-of-gamut imaginary color in L*a*b* if the user changes the saturation significantly. For this reason it is necessary to control the gamut. &lt;br /&gt;
* The &amp;quot;Avoid color shift&amp;quot; algorithm does not handle clipped highlights very well. For example it will destroy any highlight reconstruction carried out in the Exposure tab. &lt;br /&gt;
&lt;br /&gt;
Therefore, for images that have colors close to the gamut limits (e.g. flowers), that have reconstructed clipped highlights and that have undergone an increase in saturation, you can either:&lt;br /&gt;
* Not use &amp;quot;Avoid color shift&amp;quot;, in which case the blue-violet and orange-red colors will shift.&lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot; as well as &amp;quot;Munsell corrrection only&amp;quot;. This can generate imaginary colors not visible to the human eye. &lt;br /&gt;
* Use &amp;quot;Avoid color shift&amp;quot;, which by default will control the gamut and apply Munsell correction, then use an Excluding spot on the areas with reconstructed highlights that you wish to preserve. &lt;br /&gt;
&lt;br /&gt;
===Fast Fourier Transform===&lt;br /&gt;
The Fast Fourier Transform in the form &amp;quot;FFTW real DCT&amp;quot; is used in Rawtherapee and particularly in Local Adjustments in 3 ways:&lt;br /&gt;
* To create a Gaussian blur. &lt;br /&gt;
* To resolve the Poisson PDE equation after the use of a Laplace function.&lt;br /&gt;
* To reduce noise.&lt;br /&gt;
When processing large images or using Full-Image mode, the use of these functions can lead to longer processing times. &lt;br /&gt;
&lt;br /&gt;
====Gaussian Blur==== &lt;br /&gt;
A “Use Fast Fourier Transform” checkbox has been added to two of the local-adjustments tools. The Fast Fourier Transform (FFT) is used to generate the blur required for MultiScale Retinex (not used in full-image mode) and also in the Local Contrast &amp;amp; Wavelets Unsharp Mask. Note that Multiscale Retinex is invoked using the Scale slider. Higher values correspond to more iterations and a stronger Retinex effect. Increasing Scale is resource hungry especially when the blur function is used, with or without FFTW.&lt;br /&gt;
*The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
*Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2).&lt;br /&gt;
*The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations. &lt;br /&gt;
For MultiScale Retinex it is possible (but not recommended) to change the variable Fftwsigma=true in RawTherapee’s “options” file to “false”. In this case the FFT algorithm will be modified in an attempt to emulate the “older” equation without FFTW.&lt;br /&gt;
&lt;br /&gt;
====Resolving the Poisson PDE====&lt;br /&gt;
This concerns the following:&lt;br /&gt;
* Original Retinex used to attenuate luminance differences especially for portraits. &lt;br /&gt;
* Dynamic Range &amp;amp; Exposure with the following two modules: a) PDE Ipol Contrast attenuator; b) Fattal PDE - Dynamic Range Compression (similar to Dynamic Range Compression used in full-image mode).&lt;br /&gt;
&lt;br /&gt;
====Noise reduction====&lt;br /&gt;
In Local Adjustements the FFT is used in conjunction with wavelets to reduce luminance and chrominance noise (not implemented for the chrominance component in Detail &amp;gt; Noise Reduction).&lt;br /&gt;
&lt;br /&gt;
====FFT optimisation ====&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm (governed for example by the Scale slider in Multiscale Retinex ). The application of the Gaussian function is almost instantaneous and independent of the radius. It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
* The code uses a table to select the appropriate dimensions, which can currently extend to a value of L or H = 18144 pixels. &lt;br /&gt;
* The result of the optimisation is not visible in the preview. &lt;br /&gt;
* The improvement in processing time can range from a factor of 2 to 10. It will be 10 if the dimensions of the RT-spot are a multiple of 2^n and it will be 2 if there is a large combination of prime factors. Because of this the FFTW could in effect take more time for a small spot than for a large spot.&lt;br /&gt;
* Note that if you select Full Image, the area processed by the FFTW will be slightly bigger than the image size (by a few pixels) to ensure that the entire image is processed. &lt;br /&gt;
&lt;br /&gt;
====Calculation precision====&lt;br /&gt;
The FFTW uses float precision, which after testing seems to be sufficient. The errors measured on a full image after carrying out a transform followed by an inverse transform were in the order of 1/1000 and affected only a few isolated pixels. Overall there was no measurable difference. &lt;br /&gt;
&lt;br /&gt;
If necessary, it should be possible to install the double precision version of FFTW in GitHub.&lt;br /&gt;
&lt;br /&gt;
==Differences between L*a*b* in Local Adjustments and RawTherapee in general ==&lt;br /&gt;
&lt;br /&gt;
There are differences in the way some of the L*a*b* functions in Local Adjustments are implemented compared to the equivalent L*a*b* functions in the rest of RawTherapee. &lt;br /&gt;
&lt;br /&gt;
===Color &amp;amp; Light===&lt;br /&gt;
*The luminance and contrast algorithms are different to those used by L*a*b* Adjustments in the main-menu, which may lead to some differences in rendering.&lt;br /&gt;
&lt;br /&gt;
An example with Color &amp;amp; Light:[[Local_Adjustments#Adding_the_Color_&amp;amp;_Light_tool | Example in first steps with Color &amp;amp; Light]] &lt;br /&gt;
&lt;br /&gt;
[[File:Colorspace_flowers.jpg|300px|thumb|center|Original]] &lt;br /&gt;
[[File:Colorspace_flowers-grid2.jpg|300px|thumb|center|with a color-correction grid]] &lt;br /&gt;
*The ''Color correction grid'' has two options:&lt;br /&gt;
Color Toning and Direct&lt;br /&gt;
&lt;br /&gt;
* Color Toning&lt;br /&gt;
#In this case luminance is taken into account when varying chroma.&lt;br /&gt;
#It is equivalent to an H=f(H) function if the black dot only is varied on the grid and the white dot stays in the default position (note that the two dots are superposed in the default position).&lt;br /&gt;
#It is equivalent to the Color Toning function in the main-menu Color tab if you vary both the black and white dots.&lt;br /&gt;
&lt;br /&gt;
*Direct&lt;br /&gt;
# In this case the chroma is affected directly.&lt;br /&gt;
&lt;br /&gt;
You can vary the effect using the Strength and the other available sliders (depending on the level of complexity). In particular, you can limit the extent of the action using the Scope slider to isolate a particular color for example.&lt;br /&gt;
&lt;br /&gt;
*The Inverse mode, which now has a Scope function, can be used for creating gradients, vignetting, special effects, or simulating a graduated border around the image. In the case of a graduated border , if you set Lightness to -100, reduce the Chrominance and select a Scope value greater than 75, then the &amp;quot;border&amp;quot; will be black.&lt;br /&gt;
&lt;br /&gt;
Specific settings:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear if you want to work in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the delatE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
====Curves====&lt;br /&gt;
*An L=f(L) curve and a C=f(C) curve allows the luminance or chrominance for each particular RT-spot to be modulated according to the luminance or chrominance (Standard mode). &lt;br /&gt;
*An L=f(H) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the hue.&lt;br /&gt;
*A C=f(H) curve (Advanced mode) allows chrominance modulation for each RT-spot as a function of hue. &lt;br /&gt;
*An H=f(H) curve (Advanced mode) allows you to modulate the hue for each RT-spot according to the hue.&lt;br /&gt;
*An L=f(C) curve (Advanced mode) allows the luminance for each RT-spot to be modulated according to the chrominance.&lt;br /&gt;
*A C=f(L) curve (Advanced mode) allows the chrominance for each RT-spot to be modulated according to the luminance.&lt;br /&gt;
&lt;br /&gt;
To activate them, select the Normal option in the &amp;quot;Curve type&amp;quot; drop-down.&lt;br /&gt;
&lt;br /&gt;
Depending on the level of complexity, there are several additional features in Color &amp;amp; Light, for example: masking and structure detection.&lt;br /&gt;
&lt;br /&gt;
In Inverse mode the following curves are not implemented; L=f(H), H=f(H), L=f(C) &amp;amp; C=f(L). There is also no modification preview.&lt;br /&gt;
&lt;br /&gt;
* RGB Tone Curves (Advanced mode)&lt;br /&gt;
**There are 4 options for the RGB curves: Standard, Weighted Standard, Luminance &amp;amp; Film-like&lt;br /&gt;
**There is also a &amp;quot;Special use of RGB curves&amp;quot; checkbox. The design of Local Adjustments is such that the RGB tone-curve algorithm will compare the output to the original, which in certain cases can give unexpected results, especially if the curve is inverted to create a negative effect. The checkbox allows you to isolate the RGB Tone Curve processing by removing all other adjustments carried out using the Scope and other sliders, masks etc with the exception of the transition settings. Nevertheless, should you wish to further adjust the image after having checked the checkbox, you can do so by creating another RT-spot in the same position or nearby as the case may be. &lt;br /&gt;
&lt;br /&gt;
====Merge Files====&lt;br /&gt;
You can merge 2 Rt-Spots or 1 RT-spot with a background similar to the way you would use blend modes in Photoshop, GIMP etc.&lt;br /&gt;
* There are 21 blend modes: Normal, Substract, Addition, Multiply, etc.&lt;br /&gt;
* There are 3 sliders to control the action: &amp;quot;Merge background (deltaE)&amp;quot;, Opacity &amp;amp; &amp;quot;Contrast threshold&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Range &amp;amp; Exposure===&lt;br /&gt;
Slightly different from the main menu with 3 identical sliders: Amount, Detail and Anchor, which also work slightly differently.&lt;br /&gt;
The following additional functions are also available:&lt;br /&gt;
* Gamma (in Advanced mode):  Changes the gamma used by L*a*b* from the default gamma =3 to linear for working in HDR mode. A reverse gamma function is applied at the end of this process.&lt;br /&gt;
*&amp;quot;Spot structure&amp;quot;: uses the Sobel-Canny algorithm to improve the deltaE detection by taking into account the differences in structure.&lt;br /&gt;
*&amp;quot;Blur shape detection&amp;quot;:slightly blurs the result of the delatE detection to reduce possible artifacts.&lt;br /&gt;
&lt;br /&gt;
Dynamic Range &amp;amp; Exposure also has masking functions (limited in Inverse mode).&lt;br /&gt;
&lt;br /&gt;
==== Partial Differential Equation (PDE) Algorithms====&lt;br /&gt;
=====Contrast attenuator (Ipol algorithm modified by Jacques Desmis)=====&lt;br /&gt;
*This algorithm carries out contrast attenuation, which is different from dynamic range compression. It has 4 sliders:&lt;br /&gt;
** &amp;quot;Laplacian threshold&amp;quot;, which performs a convolution ignoring values below the threshold.&lt;br /&gt;
** Linearity, which increases the luminance for below-average values.&lt;br /&gt;
** &amp;quot;Laplacian balance&amp;quot;, which balances the result by mixing the PDE result with a reference standard (1 = 100% PDE).&lt;br /&gt;
** Gamma, which modifies the luminance distribution before and after the Laplacian function.&lt;br /&gt;
**The drop-down menu allows you to choose whether or not to denoise before the Laplacian function is applied. Because the denoising option in this menu ‘median) is rather destructive, it is preferable to use the Denoise module (Blur/Gain &amp;amp; Denoise), which by default will be applied prior to the Laplacian. If you wish to apply it after the Lapalcian, you can do this by creating an additional RT-spot.&lt;br /&gt;
&lt;br /&gt;
PDE solves the Poisson equation (Laplacian + Fourier) after a Fourier transform.&lt;br /&gt;
&lt;br /&gt;
====Exposure (part of Dynamic Range &amp;amp; Exposure)====&lt;br /&gt;
This module is similar to the Exposure module in global RGB mode, however:&lt;br /&gt;
* It works entirely in L*a*b* mode, hence the differences in rendering.&lt;br /&gt;
* It does not have the Lightness, Saturation and Contrast sliders as these functions can be found in Color &amp;amp; Light.&lt;br /&gt;
* There is a &amp;quot;Chroma compensation&amp;quot; slider, which is a feature of the L*a*b* mode and avoids apparent saturation variations. The default setting should be adequate in most cases.&lt;br /&gt;
* There is an additional Shadows slider (in Exposure Tools), which uses the same algorithm as Shadows/Highlights &amp;amp; Equalizer.&lt;br /&gt;
*There is a single Tone curve similar to the L=F(L) curve in Color &amp;amp; Light. The rendering of this curve will of course be different from the the L=f(L) curve in RGB mode. If you wish, you can activate both L=f(L) curves in Color &amp;amp; Light and Exposure.&lt;br /&gt;
* The selection can be refined by making small adjustments with the &amp;quot;Highlight compression&amp;quot; slider.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Shadows/Highlights &amp;amp; Tone Equalizer module can be used as an alternative to the Dynamic Range &amp;amp; Exposure module if the RT-spot is in a shaded area. &lt;br /&gt;
&lt;br /&gt;
*Note: placing the RT-spot in areas of very low luminance may give unexpected results.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Although the exposure compensation algorithm used in RawTherapee’s Exposure tab has several shortcomings, users are familiar with it and so it has has been included in Local Adjustments, albeit with some modifications to improve the behaviour. &lt;br /&gt;
* Better alternatives include (there are others in the First Steps section) :&lt;br /&gt;
** The Tone Equalizer in Shadows/Highlights &amp;amp; Tone Equalizer.&lt;br /&gt;
** The Tone Response Curve (TRC) also in Shadows/Highlights &amp;amp; Tone Equalizer (Standard mode). You can use the Slope slider to linearly lift the shadows and the Gamma slider to lift the mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
===Shadows/Highlights &amp;amp; Tone Equalizer===&lt;br /&gt;
Example using Shadows/Highlights &amp;amp; Tone Equalizer &amp;gt; Tone Response Curve(TRC): [[Local_Adjustments#Five_ways_to_change_the_exposure_and_lift_the_shadows| Example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
The module also includes:&lt;br /&gt;
* A Graduated Filter (Standard/Advanced modes) and a &amp;quot;Recovery based on luminance mask&amp;quot; function.&lt;br /&gt;
* When working on areas with deep shadows, it may be necessary to use the demoise function Blur/Grain &amp;amp; Denoise.&lt;br /&gt;
&lt;br /&gt;
====Shadows/Highlights====&lt;br /&gt;
* Available in L*a*b* mode only.&lt;br /&gt;
&lt;br /&gt;
====Tone equalizer====&lt;br /&gt;
This module was first developed for darktable and adapted to RawTherapee by Alberto Griggio. It allows you to progressively adjust the tonality as a function of the exposure values (in EV).&lt;br /&gt;
* There are 5 sliders covering the range from the deepest shadows to the brightest highlights as well as a Detail slider for fine tuning the luminance range e.g. only lift the shadows in the -16 to -18 Ev range.&lt;br /&gt;
&lt;br /&gt;
====Tone Response Curve (TRC)====&lt;br /&gt;
This module allows you to adjust the image gamma and slope:&lt;br /&gt;
* A TRC has been used rather than simple gamma controls to help reduce artifacts and improve the color rendering.&lt;br /&gt;
* The default settings with gamma = 2.4 and slope = 12.92 (sRGB) correspond to the default RawTherapee output settings (screen or sRGB). Note that all internal processing in RawTherapee uses gamma =1.&lt;br /&gt;
* Other settings can give a similar overall result but with different effects in the shadows and highlights.&lt;br /&gt;
** BT709: gamma = 2.22, slope = 4.5&lt;br /&gt;
** L*a*b*: gamma = 3.0, slope = 9.02&lt;br /&gt;
* This module allows you to adjust:&lt;br /&gt;
** Mid-tones and highlights using the Gamma slider (you can use high gamma values if necessary).&lt;br /&gt;
** Shadows using Slope (you can use high slope values if necessary).&lt;br /&gt;
&lt;br /&gt;
===Vibrance &amp;amp; Warm/Cool===&lt;br /&gt;
Overview:&lt;br /&gt;
* Masking in both Standard and Advanced modes.&lt;br /&gt;
* Graduated Filter&lt;br /&gt;
** Luminance filter in Standard mode.&lt;br /&gt;
** Luminance, Chroma &amp;amp; Hue in Advanced mode.&lt;br /&gt;
* Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
====Vibrance==== &lt;br /&gt;
Similar to the Vibrance module in the main-menu Color tab.&lt;br /&gt;
&lt;br /&gt;
====Warm/Cool====&lt;br /&gt;
A single slider that allows you to:&lt;br /&gt;
*Vary the &amp;quot;warmth&amp;quot; of the selected area.&lt;br /&gt;
*Reduce or eliminate certain color artifacts, for example when there are multiple illuminants. &lt;br /&gt;
&lt;br /&gt;
Note that this slider is not equivalent to a white balancing slider even though it may resemble it. The algorithm uses the CAT02 process, which is apart of CIECAM02 and is probably the best chromatic adaptation process currently available. &lt;br /&gt;
When you make the selected area of the image warmer with respect to the D50 reference, the slider will lower the temperature of the viewing conditions. If you make the selected area cooler, it will increase the temperature of the viewing conditions. &lt;br /&gt;
Note that you can obtain a similar result for the overall image by using the CIECAM02 module (Advanced tab) with the following settings: &lt;br /&gt;
* Scene conditions : &amp;quot;WP model&amp;quot;==&amp;gt; &amp;quot;Free temp + tint + Cat02/16 + [output], Temperature = 5000K, Surround = Average, Adaptation = 100, Yb %=18, &amp;quot;Absolute luminance&amp;quot; = 400&lt;br /&gt;
* No change to &amp;quot;Image adjustements&amp;quot;&lt;br /&gt;
* Viewing Conditions: Adaptation = 100, &amp;quot;Absolute luminance&amp;quot; = 400, Surround = Average, Yb%=18 and the Temperature set to the desired value. &lt;br /&gt;
&lt;br /&gt;
===Local Contrast &amp;amp; Wavelets===&lt;br /&gt;
There are two options:&lt;br /&gt;
* Unsharp mask: the algorithm is similar to the Unsharp Mask in the main menu Detail tab (Sharpening).&lt;br /&gt;
* Wavelets (in Standard or Advanced mode): the algorithm is similar to that used in Wavelets in the main menu (Advanced tab). However it does not include the denoise function, which is in a separate module in Local Adjustments. The functionality is similar in both the global and local-adjustments versions. Several improvements have been made to the latter which of course has the additional deltaE capability. &lt;br /&gt;
** In Standard mode, there is a simplified version of wavelets, which includes an algorithm similar to the &amp;quot;Final local contrast&amp;quot;and &amp;quot;Contrast curve&amp;quot; algorithms (used in the Residual Image section of the global wavelets module). These algorithms can provide a clarity function when combined.&lt;br /&gt;
** In Advanced mode there are two drop-down wavelet menus Pyramid 1 &amp;amp; Pyramid 2, which include the following functions:&lt;br /&gt;
*** Graduated Filter, Edge Sharpness, Blur. &lt;br /&gt;
*** Contrast by level, Tone mapping &amp;amp; Directional contrast. &lt;br /&gt;
&lt;br /&gt;
Both modules are equipped with masks and &amp;quot;Recovery based on luminance mask&amp;quot; in Standard and Advanced modes.&lt;br /&gt;
&lt;br /&gt;
====Unsharp Mask====&lt;br /&gt;
The rendering with this tool will be different because of its position in the pipeline. &lt;br /&gt;
&lt;br /&gt;
The addition of a Use Fast Fourier checkbox allows the use of a Fast Fourier Transform (FFT) to generate the blur needed for local contrast. The Gaussian function is used to generate the blur and is applied after the Fourier transform and prior to the inverse transform. &lt;br /&gt;
&lt;br /&gt;
* A Gaussian blur is applied after the transform and prior to the inverse transform. &lt;br /&gt;
* The Gaussian function G(x,y) = (1/2*PI*sigma) * exp(-(x^2 + y^2) / 2* sigma^2) &lt;br /&gt;
* The Fourier version is G(x,y) = exp((-sigma^2)*(PI * x^2 + PI * y^2))&lt;br /&gt;
This function is applicable for all radius values of sigma. &lt;br /&gt;
&lt;br /&gt;
Note that for the blur function, the use of a FFT gives a better quality result than the approach used elsewhere in RawTherapee, which is based on a series of approximations.&lt;br /&gt;
The processing time for the Fast Fourier Transform (FFT) depends on the area of the image to be processed and the number of times it is called in the algorithm, whereas the application of the Gaussian function is almost instantaneous and independent of the radius. &lt;br /&gt;
It should be noted that the FFT is optimised when the dimensions (H, W) of the area to be processed correspond to a wavelet decomposition using prime factors only: 2^n, 3^p, 5^q, 7^r, 11^a, 13^b (with a + b = 0 or 1).&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
A simple application of wavelets (without using the pyramid): [[Local Lab controls/fr#Un moment de folie - utiliser wavelet| Exemple dans Premiers pas d'utilisation de Wavelet]]&lt;br /&gt;
&lt;br /&gt;
Available controls:&lt;br /&gt;
=====Wavelet levels=====&lt;br /&gt;
* A wavelet-level selector with threshold which allows you to select a range of levels rather than simply choosing a maximum number of levels. The algorithm automatically reduces the number of levels if the selected area (in pixels) is insufficient: for level 9 a minimum of 1024 pixels is required. For level 8 the minimum = 512 pixels, level 7 = 256 pixels, level 6 = 128 pixels, level 5 = 64 pixels, level 4 = 32 pixels, level 3 = 16 pixels, level 2 = 8 pixels, level 1 = 4 pixels and level 0 = 2 pixels. &lt;br /&gt;
&lt;br /&gt;
=====Local contrast=====&lt;br /&gt;
* A Local contrast curve acts on the contrast (luminance). Attention we do not act directly on the luminance but on the wavelet decompositions of the luminance. They translate the local contrast for each level of detail, from 2x2 pixels to 1024*1024 pixels depending on the settings and are obtained from variations in the luminance of the undecomposed image. For example, uniform areas will result in zero local contrast. The levels of detail mentioned above correspond to the levels of decomposition from 0 to 9. The higher levels (typically 8 and 9) are only possible if the size of the RT-Spot and the Preview are sufficient.&lt;br /&gt;
 &lt;br /&gt;
* This curve, along with the level selector, allows you to modify the micro contrast as a function of the luminance. You can for example, increase the contrast for the midtones and lower the contrast in the shadows. If necessary, you can also add another RT-spot to make other adjustments.&lt;br /&gt;
=====Residual Image=====&lt;br /&gt;
* A slider for adjusting the contrast of the residual image.&lt;br /&gt;
* A slider for adjusting the saturation (chroma) of the residual image.&lt;br /&gt;
* Four sliders that allow you to adjust the shadows and highlights of the residual image, with the possibility of using negative values. &lt;br /&gt;
* A Gamma and a Slope slider to adjust the shadows, mid-tones and highlights.&lt;br /&gt;
&lt;br /&gt;
=====Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images (details) =====&lt;br /&gt;
* The level selector allows you to choose between Clarity and Sharp Mask. Sharp Mask is used when the selected levels are equal to or less than 4 and Clarity is used when the selected levels are 5 and above. &lt;br /&gt;
* Merge Luma allows you to select the intensity of the effect on the luminance. &lt;br /&gt;
* Merge chroma allows you to select the intensity of the effect on the chroma.&lt;br /&gt;
* The checkbox &amp;quot;Merge only with original image&amp;quot;, can be used to prevent other wavelet-pyramid adjustments being merged with the Clarity and Sharp Mask adjustments to avoid unwanted interactions. &lt;br /&gt;
* Note: &amp;quot;Merge luma&amp;quot; and &amp;quot;Merge chroma&amp;quot; , take into account all wavelet adjustments, which can be limited to just Clarity if required (see above).&lt;br /&gt;
* &amp;quot;Soft radius&amp;quot;&lt;br /&gt;
** A &amp;quot;Soft radius&amp;quot; slider (using a guided filter algorithm) allows you to reduce halos and irregularities for all wavelet-pyramid adjustments including Sharp Mask and Clarity. To deactivate it, set the slider to zero. &lt;br /&gt;
&lt;br /&gt;
=====Gamma=====&lt;br /&gt;
The &amp;quot;Gamma (wavelet pyramids)&amp;quot; slider modifies the default L*a*b* gamma value (= 3) and sets it to gamma = 1 (linear mode) for working with HDR images. The action is reversed at the end of the process. &lt;br /&gt;
&lt;br /&gt;
=====Wavelet Pyramids=====&lt;br /&gt;
======Graduated filter &amp;amp; Local Contrast======&lt;br /&gt;
* Allows you to apply a variable angle gradient to the local contrast.The gradient affects the luminance variations and not the luminance itself.&lt;br /&gt;
======Edge sharpness======&lt;br /&gt;
This module has the same purpose and the same adjustments as its equivalent in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab) and has a similar degree of complexity.&lt;br /&gt;
It targets the local-contrast effect on edges and has the same controls as its main-menu equivalent. &lt;br /&gt;
* [[Wavelet_Levels#Edge_Sharpness_module|Edge sharpness]]&lt;br /&gt;
In addition, it benefits from the specific functions in Local Adjustments such as scope, transitions, multiple selections etc.&lt;br /&gt;
&lt;br /&gt;
======Blur Levels======&lt;br /&gt;
* The &amp;quot;Blur residual image&amp;quot; slider allows you to blur the residual image. If you try varying the number of wavelet levels, you will see that using intermediate values (top right and bottom right settings on the threshold graph) can give some interesting results. &lt;br /&gt;
* The &amp;quot;Blur by level&amp;quot; curve allows you to blur any individual or range of levels. The horizontal axis of the graph represents the wavelet-decomposition level. The left-hand side corresponds to the finer details ( 2, 4, 8 pixels). The &amp;quot;Maximum blur level&amp;quot; slider allows you to set the maximum amount of blur irrespective of the &amp;quot;Wavelet levels&amp;quot; settings. The &amp;quot;Chroma levels&amp;quot; slider adjust the chroma as a percentage ( plus or minus) of the luminance.&lt;br /&gt;
&lt;br /&gt;
======Contrast by Level====== &lt;br /&gt;
* The &amp;quot;Contrast by level&amp;quot; graph in Pyramid 2 is the counterpart of Contrast By Detail Levels and also of the Contrast module in the main-menu &amp;quot;Wavelet levels&amp;quot; (Advanced tab). Once again, the horizontal axis represents the wavelet decomposition levels and the vertical axis the amount the contrast is increased or decreased. &lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider attenuates the effect of the contrast adjustments made using the &amp;quot;Contrast by level&amp;quot; graph. The adjustment will be stronger for medium-contrast details and weaker for high and low contrast details. The slider controls how quickly the effect dampens towards the extreme contrasts. The higher the value of the slider, the wider the range of contrast values that will receive the full effect of the adjustment and the higher the risk of generating artifacts. Lower values will pinpoint the adjustment towards a narrower range of contrast values. &lt;br /&gt;
* The Offset slider moves the mean value towards either the shadows or the highlights. &lt;br /&gt;
* Chroma levels : acts on the L*a*b* &amp;quot;a&amp;quot; and &amp;quot;b&amp;quot; components as a percentage of the luminance settings. &lt;br /&gt;
With this slider you can adjust the apparent contrast by reinforcing or attenuating the details (with or without using the &amp;quot;Contrast by level&amp;quot; curve). Values less than 1 reduce the effect and values greater than 1 increase it. &lt;br /&gt;
&lt;br /&gt;
======Directional Contrast======&lt;br /&gt;
You can use this module for creating a tone-mapping effect. &lt;br /&gt;
It operates on the differences in the three directions of the decomposition: horizontal, vertical and diagonal.&lt;br /&gt;
The method relies on the difference between the diagonal and the horizontal/vertical cross section to operate on the edges. &lt;br /&gt;
The action of the curve is based on the luminance.&lt;br /&gt;
* The &amp;quot;Attenuation response&amp;quot; slider allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extend of the effect beyond the mean contrast values. &lt;br /&gt;
* Delta balance allows you to target the processing towards the higher or lower levels depending on the position of the slider. Moving the slider to the left accentuates the lower levels whereas moving it to the right reduces the lower levels and accentuates the higher levels. &lt;br /&gt;
&lt;br /&gt;
======Wavelet level tone mapping======&lt;br /&gt;
Example to enhance the texture : [[Local_Adjustments#Three_ways_of_increasing_texture| Example in Getting started - with Wavelets Tone mapping]] &lt;br /&gt;
&lt;br /&gt;
This module uses wavelets only with a compression algorithm that can be applied to each decomposition level and the residual image. A guided filter helps attenuate any artifacts (see below). &lt;br /&gt;
* &amp;quot;Attenuation response&amp;quot; allows you to concentrate the action around the mean contrast values by attenuating the effect on the high and low contrast values. Moving the slider to the right will increase the extent of the effect beyond the mean contrast values.&lt;br /&gt;
* &amp;quot;Balance threshold&amp;quot; allows you to balance the effect and can in certain cases be used to lift the shadows (default value =1.4).&lt;br /&gt;
*Negative values compress the data and give a tone-mapping effect that is different from the usual algorithms (Mantiuk, Fattal etc.). The design is such that it will be more sensitive to areas with detail and less sensitive to uniform areas in the image.&lt;br /&gt;
** Positive values will reduce the apparent contrast and give an effect similar to Original Retinex. It can be an alternative to simulating dodge and burn effects with the Original Retinex tool. &lt;br /&gt;
** &amp;quot;Compress residual image&amp;quot; increases or decreases the contrast in the residual image.&lt;br /&gt;
* To help reduce artifacts, it is recommended to use Clarity &amp;amp; Sharp Mask/Blend &amp;amp; Soften Images if necessary by adjusting the value of &amp;quot;Soft radius&amp;quot;. The default value is 1 but a smaller value should be sufficient in the majority of cases.&lt;br /&gt;
&lt;br /&gt;
=====Note=====&lt;br /&gt;
* Don’t forget that you can use Scope to target the action and/or use an Excluding spot to cancel out an action in a selected area. In particular if you are using &amp;quot;Wavelet level tone mapping&amp;quot; with &amp;quot;Compression by level&amp;quot;, an Excluding spot is useful to cancel out any pronounced shadow effects. &lt;br /&gt;
=====Importance of Attenuation Response=====&lt;br /&gt;
Acts on the standard deviation (the distribution is not Gaussian but is treated as such for the purposes of the calculations). Taking into account the mean, the standard deviation and the maximum for each level in almost all the wavelet-pyramid algorithms, allows us to process the decomposition non-linearly to avoid artifacts.&lt;br /&gt;
Micro-contrast values close to the mean are amplified more than the lower and higher values.&lt;br /&gt;
&lt;br /&gt;
===Tone Mapping===&lt;br /&gt;
Example increasing texture:[[Local_Adjustments#Three_ways_of_increasing_texture| Example in First steps - increasing texture with Tone mapping ]] &lt;br /&gt;
* Masking and &amp;quot;Recovery based on luminance mask&amp;quot; available in Standard and Advanced modes.&lt;br /&gt;
* Additional Saturation slider in Advanced mode (to compensate for occasional shortcomings in the Mantiuk formula).&lt;br /&gt;
* The Strength slider has been renamed &amp;quot;Compression strength&amp;quot;, to reflect its exact function. The slider range is different: Lab Adjustments -1 to 2, Local Adjustments -0.5 to 2&lt;br /&gt;
* The Gamma range (Advanced mode) has been changed: Lab Adjustments 0.8 to 1.5, Local Adjustments 0.4 to 4 &lt;br /&gt;
* &amp;quot;Reweighting iterates&amp;quot; settings are different: Lab adjustments 0 to 9 / Local adjustments 0 to 3&lt;br /&gt;
* Additional &amp;quot;Normalize luminance&amp;quot; checkbox in Advanced mode. When activated the image luminance has the same mean and variance as the original image. &lt;br /&gt;
* Mask&lt;br /&gt;
Tone-Mapping associated with Scope can be used to adjust the image Clarity in a particular area (among other things).&lt;br /&gt;
&lt;br /&gt;
===Soft Light &amp;amp; Original Retinex===&lt;br /&gt;
&lt;br /&gt;
Soft Light is the same as the main-menu function.&lt;br /&gt;
&lt;br /&gt;
====Original Retinex==== &lt;br /&gt;
Example:[[Local_Adjustments#Dodging_and_Burning | Dodge and Burn example in First Steps]]&lt;br /&gt;
&lt;br /&gt;
Tests on the original Retinex algorithm (based on the work carried out by IPOL) have shown that it has some useful features for local editing. &lt;br /&gt;
The algorithm is different from those used elsewhere, including in Rawtherapee. It tries to translate the way the human eye perceives large variations in luminance and deep shadows, which a photographic sensor has difficulty reproducing. For example if we use a flash or strong light for a portrait, the face can end up with over-accentuated shadows and highlights, which can be compensated to a certain degree using dodge and burn techniques. &lt;br /&gt;
&lt;br /&gt;
Dodging and burning is usually carried out using a brush to lighten or darken the affected areas but with the original Retinex PDE, this is carried out automatically. &lt;br /&gt;
&lt;br /&gt;
The IPOL code used can be found here: https://www.ipol.im/pub/art/2011/lmps_rpe/ &lt;br /&gt;
It has been modified and adapted for use in RawTherapee. &lt;br /&gt;
&lt;br /&gt;
The algorithm is complex and consists of several steps:&lt;br /&gt;
# Image analysis.&lt;br /&gt;
# Application of a discrete Laplacian transform with a threshold to determine the signal strength. Strength values around 70 give an internal Laplacian threshold of around 4 (typical for Laplacian transforms).&lt;br /&gt;
# The &amp;quot;Laplacian threshold deltaE&amp;quot; slider allows the threshold to be differentiated as a function of deltaE. For values less than the threshold, the full effect of the Laplacian transform is applied. For values greater than the threshold, a second Laplacian (attenuated by 60%) is added to the first.   This mechanism differs from the Scope function (which reduces the effect globally), by allowing the user to separate the foreground from the background.&lt;br /&gt;
# Application of a two-dimensional Fourier transform (DCT: Discrete Cosinus Transform).&lt;br /&gt;
# Resolution of the Poisson equation (PDE) to &amp;quot;stabilize&amp;quot; the system. &lt;br /&gt;
# Inverse two-dimensional Fourier transform. &lt;br /&gt;
# Luminance normalization with respect to the original image (same mean and variance). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Show Fourier process&amp;quot; menu allows the user to follow the various steps i.e.&lt;br /&gt;
# Determination of the Laplacian variable (first step).&lt;br /&gt;
# Fourier transform (DCT i.e. discrete cosine transform) of the Laplacian.&lt;br /&gt;
# Resolution of the discrete Poisson equation (PDE) using the Fourier decomposition. Note the relative similarity of this image (in its Fourier form) to that of the Laplacian. &lt;br /&gt;
# Inverse transform (not visible in the preview but you can see the final result).&lt;br /&gt;
# Normalization of the luminance (in this case an absence of luminosity). &lt;br /&gt;
Try it for yourself, in particular on a portrait.&lt;br /&gt;
&lt;br /&gt;
===Dehaze &amp;amp; Retinex===&lt;br /&gt;
Dehaze is similar to Haze Removal in the Detail tab and can be combined with Retinex for better results.&lt;br /&gt;
====Retinex: Important differences with the main-menu module====&lt;br /&gt;
Example using it to increase texture : [[Local_Adjustments#Three_ways_of_increasing_texture | Example in First steps - increasing texture with Retinex]]&lt;br /&gt;
&lt;br /&gt;
In Local adjustments, Retinex is similar to the main-menu implementation, however there are some differences.&lt;br /&gt;
&lt;br /&gt;
Retinex requires stringent conditions to work optimally. It is essential to have the necessary resources to implement the very large Gaussian blur radii.&lt;br /&gt;
RawTherapee’s architecture is such that it doesn’t always meet the requirements needed to have an accurate image preview. As a result, there will be differences between the preview on screen and the TIF or JPG output.&lt;br /&gt;
These differences will be all the more important when: &lt;br /&gt;
* The RT-spot size is small.&lt;br /&gt;
* Scale values are high.&lt;br /&gt;
* The Radius is significant.&lt;br /&gt;
The algorithm in the Advanced tab, which works on the whole image, is not subject to these restrictions. &lt;br /&gt;
&lt;br /&gt;
Note also that the memory requirements and processing time required for implementing Retinex in Local Adjustments increases with: &lt;br /&gt;
* The spot size.&lt;br /&gt;
* Increasing Radius values.&lt;br /&gt;
* Increasing Scale values.&lt;br /&gt;
* The use of masks.&lt;br /&gt;
* The use of FFTW.&lt;br /&gt;
&lt;br /&gt;
Memory requirements can easily reach 6 or 8 Gbytes!&lt;br /&gt;
For example, using Retinex with an 8280*5512 pixel Nikon D850 image and the following settings (spot beyond the limits of the image, Radius = 500, Scale = 10, no masks), will result in a memory requirement of at least 9 Gb .&lt;br /&gt;
&lt;br /&gt;
====Fast Fourier Transform====&lt;br /&gt;
A Use Fast Fourier Transform checkbox has been added, which allows the FFT to be used to generate the blur required for Multi Scale Retinex.&lt;br /&gt;
It increases the quality when large radius values are used but it also increases the processing time significantly.&lt;br /&gt;
&lt;br /&gt;
====Features====&lt;br /&gt;
The following changes have been made to the user interface (GUI): &lt;br /&gt;
* A Depth slider has been added to Dehaze (previously calculated using the Retinex parameters). &lt;br /&gt;
* A checkbox allowing the user to choose between linear mode (appropriate for working on contrast) and logarithm mode (more appropriate for reducing haze). It can also generate more marked local contrast effects at the expense of an increase in halos. &lt;br /&gt;
* A &amp;quot;Transmission map&amp;quot; curve has been added to help reduce artifacts by adjusting the internal transmission parameters.&lt;br /&gt;
* The &amp;quot;Transmission map&amp;quot; and reconstructed data is now displayed.&lt;br /&gt;
*A &amp;quot;Clip restored data (gain)&amp;quot; slider has been added allowing the user to adjust the displayed &amp;quot;Transmission map&amp;quot; values in conjunction with the Threshold and Offset sliders. &lt;br /&gt;
* A &amp;quot;Reduce ΔE artifacts&amp;quot; slider has been added which acts on the data just after the &amp;quot;Transmission map&amp;quot; action. &lt;br /&gt;
* The default parameters have been changed.&lt;br /&gt;
* Dehaze has been separated out (in the GUI and partly in the algorithm).&lt;br /&gt;
** In the main-menu implementation, two separate algorithms are used (developed separately in the past) but they both have a similar purpose i.e. reduce haze.&lt;br /&gt;
** In Local Adjustments they have been included in the same interface so that the advantages of each are more easily accessible. &lt;br /&gt;
&lt;br /&gt;
The Retinex function in Local Adjustments acts at the end of the process unlike the Retinex standard mode in the main menu (Advanced tab &amp;gt; Retinex), which is at the beginning of the Raw process. The number of settings is also different. &lt;br /&gt;
It also has the following additional features: &lt;br /&gt;
&lt;br /&gt;
* A dehaze module, Dehaze &amp;amp; Retinex, which uses the same dehaze algorithm as the equivalent function in the main menu. The combination of these 2 algorithms (Retinex and Dehaze) provides a powerful tool for solving atmospheric haze problems. Each algorithm has its strengths: Retinex can differentiate between the foreground and background and Dehaze is easier to use overall and generally more relevant to a wider variety of images. &lt;br /&gt;
&lt;br /&gt;
The Retinex algorithm is only used if the Retinex Strength slider (in Advanced mode) is greater than 0.2 .&lt;br /&gt;
* If you choose Scale = 1, the Retinex algorithm is partially bypassed and the process acts similarly to a local contrast function with the possibility of using much higher values than usual. Some functions have been removed such as masks and tone mapping and others have been assigned different slider values (Radius, Variance, Threshold). &lt;br /&gt;
* Darkness and Lightness have no effect if the cursor value is set to 1. For other values, the final stage of Multiple Scale Retinex invokes an algorithm similar to that used for local contrast. The Darkness and Lightness sliders, in conjunction with the Strength slider, allow the user to adjust the local contrast upstream.&lt;br /&gt;
* The other options, Low, Uniform &amp;amp; High (drop-down menu just below Retinex Tools) along with Strength, Radius, Threshold &amp;amp; Contrast are in principle similar to the main-menu module even if some of the settings and resulting effects may differ slightly.  &lt;br /&gt;
* When the &amp;quot;Normalize luminance&amp;quot; checkbox is activated, the final image luminance will have the same mean and variance as the initial image.&lt;br /&gt;
&lt;br /&gt;
There are optional masks (Retinex only) which are essentially similar to the other masks in Local Adjustments with some particularities. They are applied either at the beginning or at the end of the Retinex process depending on the Transmission Map. &lt;br /&gt;
&lt;br /&gt;
For example, to process an image with a lot of haze:&lt;br /&gt;
* The first step is to use the dehaze function in the main menu (Detail &amp;gt; Haze Removal). In some images, the result will have little effect and the image will remain hazy.&lt;br /&gt;
* Select Dehaze &amp;amp; Retinex in Local Adjustments and position the RT-spot over the hazy area. &lt;br /&gt;
** Adjust the amount of Dehaze using the Strength, Depth and Saturation sliders. &lt;br /&gt;
** Adjust the Radius using a relatively high value (100 to 150). Note that in some cases, lower values may be sufficient. &lt;br /&gt;
** Adjust the Variance (contrast) using a relatively low value (less than 100). Note that in some cases higher values may be required. &lt;br /&gt;
** Set the Scale value to 3 or more. Higher Scale values allow you to use higher Variance values and reduce the likelihood of artifacts. &lt;br /&gt;
** Adjust Strength and Scope until you get the desired effect.&lt;br /&gt;
&lt;br /&gt;
The results are difficult to predict because sensitivity to the Threshold slider settings will depend on the image. &lt;br /&gt;
To sum up, this module addresses two essential uses, each requiring different settings:&lt;br /&gt;
* Processsing hazy images.&lt;br /&gt;
* Adding local contrast using high radius values, with the possibility of simulating a clarity function.&lt;br /&gt;
&lt;br /&gt;
=====Controlling artifacts and halos=====&lt;br /&gt;
Retinex is very efficient, but: a) it is complex, b) it can generate artifacts especially at luminance transition areas, c) it often produces halos.&lt;br /&gt;
&lt;br /&gt;
To reduce artifacts and halos, once the basic settings are chosen (Radius, Variance, Scale, Darkness, &amp;quot;Transmission gain&amp;quot; and Strength):&lt;br /&gt;
* Use the &amp;quot;Transmission map&amp;quot; data dashboard.&lt;br /&gt;
* Adjust &amp;quot;Clip restored data (gain)&amp;quot;, Offset and Threshold to obtain the Min and Max restored-data values, which should be close to 0 and 32768 respectively. Note that other values may be suitable but it’s important to respect the the orders of magnitude. Avoid for example values such as Min = -25000 and Max = 90000. &lt;br /&gt;
* If the artifacts persist, adjust the &amp;quot;Transmission map&amp;quot; curve by pulling down the middle part close to the abscissa, which corresponds to the mean data value. You can also try changing the Max and Min points on the abscissa – for example by lifting the Min value and lowering the Max value.&lt;br /&gt;
* You can also adjust the gain of the Transmission curve. &lt;br /&gt;
*Another possibility is to adjust the &amp;quot;Reduce deltaE artifacts&amp;quot; slider by increasing the value from its default position. (you can also try adjusting Scope). &lt;br /&gt;
* You can move the RT-spot to change the reference values. &lt;br /&gt;
*Of course you can also change the initial settings and start all over again! &lt;br /&gt;
*It may also help to use a mask (in &amp;quot;Mask and modifications&amp;quot;) in particular on the luminance component. When Retinex is in &amp;quot;Transmission map&amp;quot; mode with its 2 curves &amp;quot;Transmission map&amp;quot; and &amp;quot;Transmission gain&amp;quot;, you can use the mask-adjustment sliders such as Blend, &amp;quot;Soft radius&amp;quot;, etc. to optimize the contrast, the halo, the haze, etc.&lt;br /&gt;
&lt;br /&gt;
It is certainly a little complicated, but the resulting images can be well worth the effort, especially when working on the local contrast.&lt;br /&gt;
&lt;br /&gt;
===Sharpening===&lt;br /&gt;
Only RL deconvolution is available. The results are only visible at 100% zoom (1:1) or greater.&lt;br /&gt;
&lt;br /&gt;
===Contrast By Detail Levels===&lt;br /&gt;
* The minimum area is 64x64 pixels but you can effectively reduce this with the help of the Transition Gradient settings.&lt;br /&gt;
* Use preferably in 1:1 mode (100% zoom).&lt;br /&gt;
* There are no sliders for managing skin tones. They are replaced by the system used by the RT-spot.&lt;br /&gt;
* There is an additional Chroma slider. &lt;br /&gt;
* Access to the residual image has been added with the possibility of adjusting Clarity and Contrast. &lt;br /&gt;
&lt;br /&gt;
There are masks and a “Recovery based on luminance mask”  module in Standard and Advanced modes.  &lt;br /&gt;
&lt;br /&gt;
The Local Adjustments algorithm introduces several improvements: &lt;br /&gt;
* The ability to reduce skin defects.&lt;br /&gt;
* The ability to increase the impression of perspective and relief in coloured areas with fine detail (as in wavelets), with the possibility of limiting the extent of the effect (using the Scope slider).&lt;br /&gt;
* Removal of sensor defects (coloured or grey spots). &lt;br /&gt;
&lt;br /&gt;
Note: if the selected area is large and includes several objects with similar hue, chroma, luma and contrast, the algorithm will select them while leaving the rest of the image unchanged.&lt;br /&gt;
&lt;br /&gt;
===Blur/Grain &amp;amp; Denoise===&lt;br /&gt;
&lt;br /&gt;
====Blur &amp;amp; Noise====&lt;br /&gt;
* This module contains three options: Gaussian Blur-Noise-Grain, Median and Guided Filter. They can be used in the following modes: Luminance only, Chrominance only, or Luminance + Chrominance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Gaussian Blur - Noise - Grain=====&lt;br /&gt;
* Radius: a Gaussian filter is applied. Blur is active only if Radius is greater than or equal to 1.6. By reducing the default value of Scope and adjusting just the Luminance, it is possible to obtain differentiated blurs as a function of the hue Radius.&lt;br /&gt;
* Noise: Luminance noise is added to the image.&lt;br /&gt;
&lt;br /&gt;
* Film Grain:  &lt;br /&gt;
** Coarseness with 2 settings. &lt;br /&gt;
*** Distribution: simulates the ISO number.&lt;br /&gt;
*** Gamma: changes the distribution of the effect. The higher the value, the more the effect.&lt;br /&gt;
** Strength: sets the intensity.&lt;br /&gt;
** Scale: the default value is set to 100.&lt;br /&gt;
&lt;br /&gt;
=====Median=====&lt;br /&gt;
*You can choose between 3x3, 5X5, 7X7, 9X9 and the number of passes from 1 to 4 (these medians are directly derived from those used in Denoise).&lt;br /&gt;
=====Guided Filter=====&lt;br /&gt;
* You can select “Soft radius”, Strength and Detail, all of which affect the impression of strength. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This module can be used (and in particular the Median &amp;amp; Guided filters) in addition to the Denoise module for difficult images. &lt;br /&gt;
&lt;br /&gt;
===Denoise===&lt;br /&gt;
Example: [[Local_Adjustments#Using_the_Denoise_module| Example in Getting started - Using Denoise module]]&lt;br /&gt;
&lt;br /&gt;
This module is quite different from the main-menu noise reduction module for several reasons:&lt;br /&gt;
* It is equipped with a non-local means or piecewise denoising module that only deals with luminance noise.&lt;br /&gt;
* It uses the same basic wavelets functions as in the main menu Advanced tab, modified to increase the number of decomposition levels:&lt;br /&gt;
** The number of luminance levels has been changed from 5 (0 to 4) to 7 (0 to 6) to better differentiate the noise reduction especially in uniform areas (requires more resources).&lt;br /&gt;
**The number of chrominance levels has been changed from 6 (0 to 5) to 7 (0 to 6). &lt;br /&gt;
* The following additional functions have been added:&lt;br /&gt;
** The DCT (Discrete Cosine Transform) algorithm has been extended to the chrominance component.&lt;br /&gt;
**The ability to combine the wavelet actions with other tools for difficult images. For example, the  Guided Filter, which will act a bit like a bilateral filter, especially for the chrominance part.&lt;br /&gt;
* Two drop-down menus that allow the luminance noise to be adjusted based on information contained in the mask:&lt;br /&gt;
** Denoise based on luminance mask&lt;br /&gt;
** Recovery based on luminance mask&lt;br /&gt;
&lt;br /&gt;
It can also be used:&lt;br /&gt;
# To complement the main-menu noise reduction. For example apply light noise reduction to the overall image using the Noise Reduction module in the main-menu Detail tab and then carry out targeted noise reduction using the Local Adjustments Denoise module. &lt;br /&gt;
# To take advantage of the fact that Local Adjustments are in the middle of the pipeline to reduce noise generated in the intermediate processing steps (the main-menu noise reduction is carried out at the beginning of the processing pipeline). This can be done by simply adding a final RT-spot dedicated to denoising. &lt;br /&gt;
&lt;br /&gt;
====Mode====&lt;br /&gt;
There are 4 options: Off, Conservative, Agressive, “Non local means only”.&lt;br /&gt;
* “Non-local means only”: uses patch-based denoising only (no wavelets). &lt;br /&gt;
* Conservative and Agressive use wavelets.&lt;br /&gt;
With the exception of “Non local means only”, you can combine wavelets (luminance and/or chrominance) with non-local means.&lt;br /&gt;
&lt;br /&gt;
====Non-local means (patch-based noise reduction)====&lt;br /&gt;
What is patch-based noise reduction? Unlike the usual noise-reduction filters that average the values of a group of pixels located around a target pixel in order to reduce noise, the non-local-means filter averages all the pixel values contained in the image, weighted according to their similarity to the target pixel. This approach reduces loss of detail compared to filters using local means.&lt;br /&gt;
There are 5 sliders:&lt;br /&gt;
* Strength: governs the intensity of the action (at zero there is no action).&lt;br /&gt;
* Detail recovery: uses a Laplacian to target the action towards uniform areas and preserve the structure or detail.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Maximum patch size”:  adapts the noise reduction to the size of the objects to be denoised.&lt;br /&gt;
* “Maximum radius size”: high values increase the noise reduction at the expense of processing time.&lt;br /&gt;
&lt;br /&gt;
====Wavelets====&lt;br /&gt;
This module has 6 functions and must be used in 1:1 mode (100% zoom):&lt;br /&gt;
# Carry out noise reduction on a selected area (as a function of color for example) and leave the rest of the image untouched.&lt;br /&gt;
# Reduce the noise in an area where noise has been increased following a significant increase in exposure or after lifting the shadows.&lt;br /&gt;
# Introduce a Gaussian blur on the lower wavelet levels (for levels 0, 1 &amp;amp; 2) to simulate a bokeh effect. &lt;br /&gt;
&lt;br /&gt;
* The minimum wavelet action area is 128 pixels * 128 pixels.&lt;br /&gt;
*There are fewer curves but more cursors to select the right level of wavelet decomposition and refine the result.&lt;br /&gt;
=====Luminance=====&lt;br /&gt;
The luminance noise reduction module has:&lt;br /&gt;
* A curve which allows you to distribute the action. The y-axis corresponds to the strength and the x-axis to the level of wavelet decomposition (fine details from 0 to 2, areas with little detail from 3 onwards).  &lt;br /&gt;
* Uses a DCT (Discrete Cosine Transform) function to progressively recover details. With the sliders set to 0, the DCT action is maximum. To recover details, increase the values.&lt;br /&gt;
* “Equalizer white-black”: allows you to carry out more or less noise reduction in the shadows or highlights.&lt;br /&gt;
* Gamma: low values preserve detail and structure, high values increase the noise reduction.&lt;br /&gt;
* “Denoise hue equalizer”: curve that allows you to adjust the noise reduction according to the hue.&lt;br /&gt;
&lt;br /&gt;
=====Chrominance=====&lt;br /&gt;
* You can differentiate the action on the chrominance according to the coarseness of the noise: “Fine chroma (Wav)” corresponds to the first 4 levels and “Coarse chroma (Wav)” corresponds to levels higher than 4.&lt;br /&gt;
* There is also a DCT slider for chrominance noise: “Chroma detail recovery”: The default value is 50%. It is disabled when the value = 100.&lt;br /&gt;
** The algorithm also uses a Fourier transform for the chrominance. With the slider at 0, the DCT has minimum effect. Increasing the value will progressively restore the details. &lt;br /&gt;
* Chroma quality improvement&lt;br /&gt;
** If you move the &amp;quot;Coarse chroma (Wav)&amp;quot; slider to 1, it activates an improved algorithm for chrominance noise reduction. It makes 2 passes:&lt;br /&gt;
** When it is set to &amp;quot;1&amp;quot; it only improves fine noise.&lt;br /&gt;
** When it is set to &amp;quot;2&amp;quot; the coarse algorithm is activated.&lt;br /&gt;
* Equalizer Color: Allows you to direct the chroma noise reduction towards either the blue-yellow or the red-green color range.&lt;br /&gt;
&lt;br /&gt;
=====Two Expanders=====&lt;br /&gt;
======Denoise based on luminance mask======&lt;br /&gt;
Allows you to reduce the image noise as a function of the luminance information contained in the L(L) or LC(H) mask (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
&lt;br /&gt;
* “Renforce dark/light areas”: allows you to target the noise reduction in light or dark areas. &lt;br /&gt;
The two sliders below act in conjunction with &amp;quot;Renforce dark/light areas&amp;quot;:&lt;br /&gt;
* “Dark area luma threshold”: if “Renforce dark/light areas” is greater than 1, the noise reduction is gradually increased from 0% for the dark threshold setting (default set to 12) to 100% for the maximum dark value (determined by the mask).&lt;br /&gt;
* “Light area luma threshold”: The noise reduction is gradually reduced from 100% for the threshold setting (default set to 85) to 0% for the maximum white value (determined by the mask).&lt;br /&gt;
* In the area between the two thresholds, the denoise settings are not affected by the mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Recovery based on luminance mask======&lt;br /&gt;
Allows you to target the noise reduction based on the luminance information of the image contained in the L(L) or LC(H) masks (“Mask and modifications”).&lt;br /&gt;
The L(L) mask or LC(H) mask must be enabled to use this function.&lt;br /&gt;
* If the mask is below the “Dark area luma threshold” (default 12), the noise reduction will be applied progressively.&lt;br /&gt;
* If the mask is above the “Light area luma threshold” (default 85), the noise reduction will be applied progressively.&lt;br /&gt;
* Between the two, the image settings without denoise will be maintained unless you adjust the “Gray area luminance denoise” or “Gray area chrominance denoise” sliders.&lt;br /&gt;
&lt;br /&gt;
=====Other controls=====&lt;br /&gt;
* The Scope slider allows you to vary the action as a function of the deltaE of the subject and the RT-spot transition gradient. Noise reduction will be maximum in those areas where deltaE is fully taken into account and will diminish in those areas where the deltaE detection is reduced either because of the Scope slider setting or the transition gradient settings or both. &lt;br /&gt;
* If you adjust either of the &amp;quot;chroma&amp;quot; sliders, a slight increase in saturation will be applied.&lt;br /&gt;
&lt;br /&gt;
====Combined adjustment with Blur &amp;amp; Noise====&lt;br /&gt;
In certain noise situations it can be useful to blur the background and isolate the subject or foreground. You can do this using the following filters:&lt;br /&gt;
* Gaussian Blur-Noise-Grain &lt;br /&gt;
* Median &lt;br /&gt;
* Guided Filter, which will function similarly to a bilateral filter on the chrominance component in particular.&lt;br /&gt;
&lt;br /&gt;
====Bilateral Filter====&lt;br /&gt;
The ‘Bilateral filter is a replica of the Impulse Noise Reduction filter in the main-menu Detail tab. It’s primary function is to reduce the salt &amp;amp; pepper noise often found in black and white images but it can also filter other types of impulse noise.&lt;br /&gt;
&lt;br /&gt;
===Log Encoding===&lt;br /&gt;
====Some links to Log Encoding====&lt;br /&gt;
Example showing how it can be used:&lt;br /&gt;
 &lt;br /&gt;
[[Local_Adjustments#Log_Encoding| Log Encoding ]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Log_Encoding_and_Highlight_Recovery | Log Encoding and highlight recovery]]&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Other_Examples_Log_Encoding| Other examples using Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
This module is derived from the excellent module developped by Alberto Aggrigio in ART. It allows you to process underexposed images or images with a high dynamic range. It encodes the data with a logarithmic scale to ensure intelligent data compression.&lt;br /&gt;
&lt;br /&gt;
The RGB log encoding module in RawTherapee incorporates some of the features of the CIECAM modules used elsewhere in Local Adjustments and in the Advanced tab and shares the same vocabulary and presentation. In particular, it incorporates some of the adjustment parameters of the CAM 16 module. &lt;br /&gt;
The first step in the process is to determine the Black Ev and White Ev values so that the dynamic range can be calculated. The default value is 15 Ev (White Ev = +10, Black Ev = -5 Ev, “Mean luminance (Scene conditions)” = 10%). This estimation is done upstream in the processing pipeline with a copy of the image being made just after the colorimetric conversion to sRGB or Prophoto etc. It is therefore prior to any RGB adjustments in the main processing pipeline and prior to any local adjustments.&lt;br /&gt;
&lt;br /&gt;
The Scope function is incorporated and allows the action to be targeted to certain areas of the image based on deltaE.&lt;br /&gt;
&lt;br /&gt;
====Relative Exposure Levels====&lt;br /&gt;
* If you click on the Automatic button, the system will calculate the black Ev and white Ev values. &lt;br /&gt;
* The algorithm takes into account the size of the RT-spot and if necessary will detect any high contrast or dark areas. If you choose a full-image RT-spot and set the Scope to 100, you will obtain similar results to those obtained with ART.   &lt;br /&gt;
&lt;br /&gt;
You can of course adjust the black Ev and white Ev values directly.&lt;br /&gt;
&lt;br /&gt;
The checkbox  &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; is activated by default. &lt;br /&gt;
&lt;br /&gt;
* With &amp;quot;Black-Ev and White-Ev for whole image&amp;quot; deactivated, positioning the RT-spot over a light area may give an abnormally high Mean Luminance value (in Scene Conditions). In this case: &lt;br /&gt;
** Position the RT-spot over a darker area.&lt;br /&gt;
** Reduce the &amp;quot;Mean luminance&amp;quot; value manually. &lt;br /&gt;
* Or activate the checkbox.&lt;br /&gt;
&lt;br /&gt;
====Scene Conditions====&lt;br /&gt;
Leave “Auto mean luminance (Yb%)” checked if you want the algorithm to automatically take into account the gray point before processing. Two algorithms are used for the automatic calculation. If the first one used for the original calculation fails (possible in certain circumstances), a second calculation based on Yb (mean luminance) is used instead. &lt;br /&gt;
There are three adjustments available:&lt;br /&gt;
*  “Mean luminance (Yb%)”: Yb is the relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image.&lt;br /&gt;
* Absolute luminance: corresponds to the luminance in candelas per m2 at the time of shooting, automatically calculated from the exif data.&lt;br /&gt;
* Surround: changes the tones and colors to take into account the conditions of the scene.&lt;br /&gt;
** Average: average (standard) lighting environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly brighter.&lt;br /&gt;
** Very Dark. The image becomes brighter&lt;br /&gt;
&lt;br /&gt;
====CAM16 Image Adjustments====&lt;br /&gt;
* Local contrast: acts mainly on high frequencies (Basic mode)&lt;br /&gt;
* Contrast J: contrast using relative luminance (Standard mode)&lt;br /&gt;
* Contrast threshold (J &amp;amp; Q): adjusts the midtones of the 2 contrasts J &amp;amp; Q (Standard mode)&lt;br /&gt;
* Saturation: acts mainly on the midtones and highlights (Standard mode)&lt;br /&gt;
&lt;br /&gt;
In “All tools” (Advanced mode)&lt;br /&gt;
* Lightness J = lightness - relative luminance&lt;br /&gt;
* Brightness Q: clarity - absolute luminance&lt;br /&gt;
* Contrast Q: contrast using absolute luminance&lt;br /&gt;
* Chroma: the color of a stimulus relative to the brightness of a stimulus that appears white under identical conditions.&lt;br /&gt;
* Colorfulness: the perceived amount of tint in relation to gray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Viewing Conditions====&lt;br /&gt;
* Mean Luminance (Yb%): relative luminance of the background, expressed in % gray. 18% gray corresponds to a background luminance of 50% expressed in CIE L. The data is based on the average luminance of the image (at the desired output)&lt;br /&gt;
* Absolute luminance: absolute luminance of the output environment (default 16cd/m2)&lt;br /&gt;
* Chromatic adaptation: chromatic adaptation allows a color to be interpreted according to its spatial and temporal environment. Can be used when the white balance deviates significantly from the D50 reference. Adapts the colors to the lighting of the output device.&lt;br /&gt;
* Surround: modifies tones and colors to take into account the conditions of the output environment.&lt;br /&gt;
** Average : average (standard) light environment.&lt;br /&gt;
** Slightly Dark (Dim): dark environment. The image becomes slightly dark.&lt;br /&gt;
** Very Dark: the image becomes darker&lt;br /&gt;
** Extremely Dark: the image becomes very dark&lt;br /&gt;
&lt;br /&gt;
====Graduated Filter====&lt;br /&gt;
At the end of the log processing, you can act on the resulting luminance with a Graduated Filter equipped with 2 sliders: “Gradient strength” and “Gradient angle”.&lt;br /&gt;
&lt;br /&gt;
===Color appearance (Cam16 &amp;amp; JzCzHz)===&lt;br /&gt;
Example using Color Appearance and HDR functions:[[Local_Adjustments#HDR_to_SDR:_A_First_Approach_(Log_Encoding_-_CAM16_-_JzCzHz_-_Sigmoid) |HDR-SDR First approach : Log encoding – Cam16 – JzCzHz – Sigmoid]]&lt;br /&gt;
&lt;br /&gt;
The Color appearance module (Cam16 &amp;amp; JzCzHz) is both:&lt;br /&gt;
* Easier than Color Appearance &amp;amp; Lighting(Ciecam02/16).&lt;br /&gt;
** It does not have CAM02, only Cam16.&lt;br /&gt;
** No Automatic symmetric, or Mixed mode. So no possibility of chromatic adaptation at the end of the process.&lt;br /&gt;
** No choice of white-point model and no choice of illuminant.&lt;br /&gt;
** No separate CAT02/16 adaptation settings (Scene and Viewing conditions).&lt;br /&gt;
** No temperature and hue settings in Viewing conditions.&lt;br /&gt;
* More complete than Color Appearance &amp;amp; Lighting(Ciecam02/16) and depending on the level of complexity (Basic, Standard, Advanced):&lt;br /&gt;
** Can take into account HDR PQ (Peak Luminance): i.e. a first approach to HDR processing.&lt;br /&gt;
** Incorporates Sigmoid Q &amp;amp; Log Encoding Q function, taking into account Black Ev and White Ev.&lt;br /&gt;
** Includes masks.&lt;br /&gt;
** Includes in Advanced mode, an experimental JzCzHz module (for improved HDR processing).&lt;br /&gt;
Overall the Color Appearance module (Cam16 and JzCzHz) is simpler (at least for the Cam16 part), is more intuitive and takes into account the possibilities of Local Adjustments i.e. deltaE, Scope, Transition Gradients, Excluding spots, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an overview of Cam16: [[Local_Adjustments#Using_the_Cam16_and_HDR_functions|Using_Cam16_and_HDR_features]]&lt;br /&gt;
&lt;br /&gt;
For a presentation of JzCzHz :[[Local_Adjustments#An_experimental_JzCzHz_module| Experimental JzCzHz module]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see the tutorial: [[CIECAM02#Color_Appearance_&amp;amp;_Lighting_(CIECAM02/16)_et_Color_Appearance_(Cam16_&amp;amp;_JzCzHz)_-_Tutorial |Tutorial Color Appearance &amp;amp; Lighting (CIECAM02/16) and Color Appearance (Cam16 &amp;amp; JzCzHz)]]&lt;br /&gt;
It should be noted that the JzCzHz module contains all the tools necessary to replace Lab:&lt;br /&gt;
* Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz).&lt;br /&gt;
* “Shadows/Highlights Jz”.&lt;br /&gt;
* Wavelets Jz.&lt;br /&gt;
** “Local contrast”.&lt;br /&gt;
** “Clarity &amp;amp; Sharp mask”.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10818</id>
		<title>Toolchain Pipeline</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10818"/>
		<updated>2024-08-27T10:52:50Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Local Contrast */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Toolchain Pipeline and Colorimetry&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Toolchain Pipeline ==&lt;br /&gt;
&lt;br /&gt;
=== Processing Order ===&lt;br /&gt;
&lt;br /&gt;
Everything that happens to an image, from the moment you open the file to the moment it is displayed on screen or saved, takes place in a fixed order. The data flows from one module to another - this is the toolchain pipeline. RawTherapee contains four pipelines (one for the main preview, one for the saved image, one for the thumbnail, and one other that currently escaped me). The following list shows a simplified order of operations:&lt;br /&gt;
&lt;br /&gt;
# Preprocess&lt;br /&gt;
## Dark frame&lt;br /&gt;
## Flat field&lt;br /&gt;
## Bad pixels&lt;br /&gt;
## Hot pixels&lt;br /&gt;
## Scale colors (internal, no tool in UI)&lt;br /&gt;
## Raw black point&lt;br /&gt;
## Lens distortion correction&lt;br /&gt;
## Green equilibration&lt;br /&gt;
## Line noise filter&lt;br /&gt;
## Chromatic aberration Correction&lt;br /&gt;
## Raw white point&lt;br /&gt;
## Raw histogram&lt;br /&gt;
## Prepare Auto Exposure&lt;br /&gt;
# Demosaic&lt;br /&gt;
# Retinex&lt;br /&gt;
# Highlight recovery&lt;br /&gt;
# White balance&lt;br /&gt;
# Spot Removal&lt;br /&gt;
# Crop&lt;br /&gt;
# Convert colorspace&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Dehaze&lt;br /&gt;
# Dynamic range compression&lt;br /&gt;
# (Local Adjustments branch) avoid color shift, Log encoding, blur-noise denoise, tone-mapping, dehaze &amp;amp; retinex, contrast by detail levels, vibrance, soflight, local contrast, wavelet, sharp, exposure, color and light, Color appearance (Cam16 &amp;amp; JzCzhz), avoid color shift&lt;br /&gt;
# Auto-match tone curve&lt;br /&gt;
# Tone response curve&lt;br /&gt;
# Process RGB&lt;br /&gt;
## Channel mixer&lt;br /&gt;
## Tone curve&lt;br /&gt;
## Highlights&lt;br /&gt;
## Shadows&lt;br /&gt;
## RGB curves&lt;br /&gt;
## HSV curves&lt;br /&gt;
## Color toning&lt;br /&gt;
## Film simulation&lt;br /&gt;
## Black-and-white&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
# Process Lab&lt;br /&gt;
## Shadows/Highlight (Lab)&lt;br /&gt;
## Local contrast (Lab)&lt;br /&gt;
## Lab adjustements&lt;br /&gt;
## Vibrance&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
## Vignette filter&lt;br /&gt;
## Graduated filter&lt;br /&gt;
## Tone mapping&lt;br /&gt;
## Impulse noise reduction&lt;br /&gt;
## Defringe&lt;br /&gt;
## Edges&lt;br /&gt;
## Microcontrast&lt;br /&gt;
## Sharpening&lt;br /&gt;
## Contrast by Detail Levels&lt;br /&gt;
## Wavelets&lt;br /&gt;
## Soft light&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Resize&lt;br /&gt;
## Post-resize sharpening&lt;br /&gt;
# Final Lab -&amp;gt; RGB conversion&lt;br /&gt;
&lt;br /&gt;
=== List of All Tools in RawTherapee ===&lt;br /&gt;
&lt;br /&gt;
* Generic/Main preview&lt;br /&gt;
** Input profile&lt;br /&gt;
** Monitor Color Profile&lt;br /&gt;
** Working profile&lt;br /&gt;
** Output profile&lt;br /&gt;
** Clipping indication&lt;br /&gt;
** Red/Green/Blue/Luminosity/Focus mask previews&lt;br /&gt;
** Colorimetric intent&lt;br /&gt;
* Exposure Tab&lt;br /&gt;
** Exposure&lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Mapping&lt;br /&gt;
** Dynamic Range Compression&lt;br /&gt;
** Vignette Filter&lt;br /&gt;
** Graduated Filter&lt;br /&gt;
** Lab Adjustments&lt;br /&gt;
* Detail Tab&lt;br /&gt;
** Sharpening&lt;br /&gt;
** Local Contrast&lt;br /&gt;
** Edges&lt;br /&gt;
** Microcontrast&lt;br /&gt;
** Impulse Noise Reduction&lt;br /&gt;
** Noise Reduction&lt;br /&gt;
** Defringe&lt;br /&gt;
** Contrast by Detail Levels&lt;br /&gt;
** Haze Removal&lt;br /&gt;
* Color Tab&lt;br /&gt;
** White Balance&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Channel Mixer&lt;br /&gt;
** Black-and-White&lt;br /&gt;
** HSV Equalizer&lt;br /&gt;
** Film Simulation&lt;br /&gt;
** Soft Light&lt;br /&gt;
** RGB Curves&lt;br /&gt;
** Color Toning&lt;br /&gt;
** Color Management&lt;br /&gt;
* Advanced Tab&lt;br /&gt;
** Retinex&lt;br /&gt;
** CIE Color Appearance Model 2002&lt;br /&gt;
** Wavelet Levels&lt;br /&gt;
* Transform Tab&lt;br /&gt;
** Crop&lt;br /&gt;
** Resize&lt;br /&gt;
** Lens/Geometry&lt;br /&gt;
*** Rotate&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profiled Lens Correction&lt;br /&gt;
*** Distortion Correction&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
*** Vignetting Correction&lt;br /&gt;
* Raw Tab&lt;br /&gt;
** Sensor with Bayer matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
*** Preprocessing&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
** Sensor with X-Trans matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
** Raw White Points&lt;br /&gt;
** Preprocessing&lt;br /&gt;
** Dark Frame&lt;br /&gt;
** Flat-Field&lt;br /&gt;
** Film Negative&lt;br /&gt;
** Capture Sharpening&lt;br /&gt;
&lt;br /&gt;
== Colorimetry ==&lt;br /&gt;
&lt;br /&gt;
=== The Importance of CIECAM and L*a*b* ===&lt;br /&gt;
&lt;br /&gt;
Colorimetry gives rise to a lot of debate but we have to remember that it is not an exact science. No amount of equations, however complex, can ensure that the human eye will necessarily be satisfied with an image. &lt;br /&gt;
&lt;br /&gt;
Currently RawTherapee uses the L*a*b* color space and CIECAM02/16 for chromatic adaptation and work has begun on exploring other color spaces (Jzazbz) and CAM models, for HDR applications (ZCAM does not work)..&lt;br /&gt;
 &lt;br /&gt;
The use of the L*a*b* (or CIELAB) color space does have its limitations but many of its shortcomings can be successfully mitigated, at least for SDR applications.&lt;br /&gt;
 &lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* One of the most frequent criticisms is that L*a*b* is non-linear and that it &amp;quot;distorts&amp;quot; the colors, in particular for blue-violet and red-orange. This is certainly true if you simply adjust the image using curves or chromaticity sliders. However in RawTherapee, if you click on &amp;quot;Avoid color shift&amp;quot; (Munsell correction), nearly 200 LUTs will correct these shifts and make the image perfectly linear. &lt;br /&gt;
* It is also said that L*a*b* addresses imaginary colors if the working profile allows it. This is also true but again, this can be compensated in RawTherapee by enabling &amp;quot;Avoid color shift&amp;quot;. In this case, a relative colorimetric correction is applied to the working gamut as follows:  &lt;br /&gt;
** It analyzes the image data.&lt;br /&gt;
** If it is within gamut no action is taken.&lt;br /&gt;
** If it is outside gamut,the chroma is reduced and if this is insufficient, or if it is close to L=0 or L=100, then L is adjusted.&lt;br /&gt;
** You can also choose the algorithm developed by Emil Martinec (gamutmap) which provides XYZ control (absolute or relative).&lt;br /&gt;
** However this should rarely occur if Prophoto is used in the Working Profile and is probably not important.&lt;br /&gt;
** If the saturation has been adjusted (chroma, vibrance,…), a Munsell correction using nearly 200 LUTs is applied. This will correct any color shifts with a high degree of accuracy e.g a red that has turned orange because of L*a*b*, will become red again. There will still be some errors but they are very small.&lt;br /&gt;
** The Munsell correction is applied in all cases unless none is selected.&lt;br /&gt;
&lt;br /&gt;
==== L*a*b* ====&lt;br /&gt;
&lt;br /&gt;
*  L*a*b* is a reversible transformation of XYZ (in simplified terms, Y is transformed into L* using a gamma of 3.0 and a slope of 9.03). L*a*b* has more or less the same characteristics in terms of its limits (those of the primaries) as XYZ, which serves as a reference for the Working Profile and determines the basis of the gamut. Therefore L*a*b* and XYZ have essentially the same characteristics (exposure range, gamut, etc.). One point however, in many processes the values of L* can be bounded (clipped), to limit artifacts (high contrasts, highlights...), but in most cases L* is unbounded. If we ever get to HDR processing, we'll probably have to switch to &amp;quot;HDR-Lab&amp;quot;. The data is not lost, even for high-dynamic range images (&amp;gt;= 25Ev), but the progression in the highlights is not progressive enough when used with monitors capable of displaying luminance values in the range of 120 cd/m² and beyond.&lt;br /&gt;
* I don’t think that the RGB-&amp;gt;Lab transformation itself prevents complete HDR processing. This is because the calculations are generally carried out using ‘float’ or ‘double’ data values (32 or 64 bits) or using SSE (128 bit - 4x32 or 2x64 bits). The linear part of the Lab transform allows shadows with values of 0.005 cd/m2 or less to be processed. The parabolic part (gamma = 3.0) limits the distribution of data in the highlights allowing them to be reproduced more accurately (on suitable monitors) with luminance values above 120 cd/m2. The XYZ&amp;lt;=&amp;gt;Lab conversion leads to hardly any loss of data (insignificant due to double conversions) and can be considered as a kind of lossless compression. Of course if we want to achieve complete HDR processing, it is necessary to ensure that the way the data is processed, prior to being sent to the monitor, allows for more progression in the highlights. The preferred approach for Rawtherapee would be to implement HDR-Lab instead of Lab. But in the meantime I have implemented the possibility of changing the gamma of Lab (3.0) for several tools (wavelets, tone-mapping, etc.) notably to make it linear. It should be noted that Rawtherapee is designed to overcome one of the problems with Lab, which is the non-preservation of the hue when the saturation changes (especially in oranges and purples), by using &amp;quot;Perceptual Uniform Lab&amp;quot;. This involves using a series of Munsell LUTs, as well as gamut control to prevent virtual colors.&lt;br /&gt;
&lt;br /&gt;
====L*a*b* does not impact the gamut or the dynamic range of high-dynamic-range images as shown in the following example with a Dynamic Range of 25Ev====&lt;br /&gt;
Note that the majority of digital cameras in 2024 have a maximum dynamic range of about 15Ev. This image is therefore exceptional but demonstrates the behavior of Lab* for images with a high dynamic range.&lt;br /&gt;
&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of L*a*b* does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
==== CIECAM02/16 ====&lt;br /&gt;
&lt;br /&gt;
* One criticism of Ciecam02 is that is not able to process high dynamic range and wide color gamut images, which is partially true. A number of improvements were made by the development team a few years ago to mitigate this problem (bearing in mind that a large number of user images fall within the sRGB gamut and do not pose a problem). However, by using Log Encoding in conjunction with Cam16, or Color appearance (Cam16 &amp;amp; JzCzHz), the vast majority of problems can be solved. Of course some images will still present problems, in particular with highlight reconstruction, but this is not specific to Ciecam. The addition of Ciecam16 (Cam16) solves some of these problems.&lt;br /&gt;
* Ciecam02/16 is one of the only ways to achieve true colorimetric correction because it takes into account human perception and the surrounding environment. With Ciecam for example, any adjustments to the luminosity and/or the saturation, will take into account the image and its environment.&lt;br /&gt;
&lt;br /&gt;
==== White Balance ====&lt;br /&gt;
&lt;br /&gt;
* White balance is also subject to debate. The Temperature Correlation module recently introduced in Rawtherapee is almost mathematically (cognitively) perfect. It makes the xyY colors of the image coincide with known spectral data. However, on images where the temperature deviates a long way from D50, the colorimetry will not be correct because there will not be the necessary chromatic adaptation expected by our eyes and brain. Ciecam however, can take this into account.&lt;br /&gt;
&lt;br /&gt;
=== Importance of the Linear-RGB Model and Colorimetry ===&lt;br /&gt;
&lt;br /&gt;
The merits of the RGB model, and in particular, the linear RGB model are frequently cited. It is certainly the best way to carry out “upstream” processing (demosaicing, white balance, defringing, chromatic aberration correction, etc.) and anything that can be done in this mode should be.&lt;br /&gt;
&lt;br /&gt;
However, CIELAB and Ciecam02/16 still have their place despite their shortcomings. As we have seen above, they are both derived from the CIE XYZ tristimulus values with Ciecam being one of the only ways to achieve true colorimetric correction.&lt;br /&gt;
&lt;br /&gt;
So what about tone curves?&lt;br /&gt;
&lt;br /&gt;
* Not only are they non-linear but they only provide limited colorimetric compensation, if any (with the exception of the Perceptual mode, which uses Ciecam02). This is in contrast to the Tone Response Curves -TRC- used for output (monitor, TIF etc.).&lt;br /&gt;
* The Auto-Matched Tone Curve, which is a copy of the in-camera TRC, is applied mid-process and introduces non-linearities in the processing pipeline.&lt;br /&gt;
&lt;br /&gt;
What about saturation?&lt;br /&gt;
&lt;br /&gt;
* Maintaining RGB linearity when you change the saturation is not impossible but it is difficult and is not implemented in Rawtherapee. On the other hand, if you adjust the saturation using Ciecam, it will take into account variations in luminance (or brightness) and adapt the color accordingly.&lt;br /&gt;
&lt;br /&gt;
In conclusion, RGB, L *a *b *, and Ciecam all have their advantages and disadvantages. They simply need to be understood so that they can be used appropriately.&lt;br /&gt;
&lt;br /&gt;
===What are the acceptable principles for processing SDR or HDR images?===&lt;br /&gt;
The argument below is partly based on the fact that Rawtherapee has two Ciecam modules, one located at the end of the main process (Color Appearance &amp;amp; Lighting), the other in Selective Editing, Color Appearance (Cam16) located just after white balance. These 2 modules are Color Appearance Models (CAMs) and contain all the processes and tools needed to ensure good colorimetry. However, these 2 modules alone are not always able to process:&lt;br /&gt;
a) images with a very high dynamic range, &lt;br /&gt;
b) images with very pronounced shadows, &lt;br /&gt;
c) images with strong highlights (not to be confused with highlight reconstruction).&lt;br /&gt;
&lt;br /&gt;
The science of colour matching is often inexact and imprecise. Nevertheless, as we have seen, the most linear treatment possible seems to be recommended if practicable. However, this seems impossible if the differences linked to a) b) c) above are significant. &lt;br /&gt;
In these cases, I propose as a first step a principle close to that of the rendering of human vision: a linear part (slope) to ‘unblock’ the shadows and a parabolic part (gamma) to render the perception of medium tones and highlights fairly similar to that of our eye/brain pair. This linear/parabolic differentiation is commonly used in various software applications e.g., sRGB gamma where Slope =12.92 and Gamma=2.4, or BT709 where slope=4.5 and Gamma=2.22 or ‘Lab’ where Slope=9.03 and Gamma=3.0.&lt;br /&gt;
The two Tone Response Curve (TRC) modules present in the Abstract Profile module or in Selective Editing &amp;gt; Color Appearance &amp;gt; Source Data Adjustments provide a partial response to the problems described in a) and b), by allowing adjustments to be carried out with higher Slope and Gamma values.&lt;br /&gt;
&lt;br /&gt;
The problem of reducing highlights, improving overall contrast and using local contrast still remains and will be discussed below.&lt;br /&gt;
&lt;br /&gt;
Don't forget that Cam16 is a processing module in its own right. You can use it to process images using tools such as:&lt;br /&gt;
* Surround or Scene conditions ( average, dim, dark etc.) which allows you to take dark or very dark backgrounds into account. This algorithm alone can provide shadow enhancement in certain images.&lt;br /&gt;
*Lightness, Brightness (and their corresponding contrast parameters), Chroma, Saturation, Colorfulness, etc.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above, colorimetry is not an exact science so you should use whichever tools give a result that is pleasing to your eye. &lt;br /&gt;
&lt;br /&gt;
===How useful are ICC and DCP input profiles ? ===&lt;br /&gt;
Raw files are generally decoded using a matrix (from Adobe) called ‘Color Matrix1’ based on the D65 illuminant. This matrix is sufficient in the vast majority of cases.&lt;br /&gt;
It can be replaced by either an ICC profile or a DCP profile that has been developed either by the user, using a Colorchecker24 for example, or supplied by Rawtherapee or Adobe.&lt;br /&gt;
There are two broad problems with these sorts of profiles:&lt;br /&gt;
* The Colorchecker24 is limited (with one exception in blues) to the sRGB gamut. What happens when such a profile is used, for example, on images of flowers or minerals where the gamut is much larger?&lt;br /&gt;
* The profile is only really relevant for a given illuminant. What happens when a profile developed for D50 (daylight in the sun) is used in the shade? It is true that DCP profiles have an interpolation table between D65 and Tungsten 2850K, but this is still approximate.&lt;br /&gt;
My point is not to say that you shouldn’t use these profiles, which are very useful for reproducing paintings, coins, etc. in controlled lighting, but to show their limitations.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Auto-Matched Tone Curve?===&lt;br /&gt;
The answer is: maybe? &lt;br /&gt;
This curve generated from the JPEG attached to the Raw reproduces the colourimetry of the camera manufacturer (Canon, Nikon, Sony, etc.). This is a criterion of choice, but it has a few constraints:&lt;br /&gt;
* The generated curve can lead to an increase in contrast which, depending on the image, may cause clipping in the shadows and highlights. In many cases, this increase in contrast is undesirable.&lt;br /&gt;
* The default choice of ‘Film-like’ modifies the colorimetry. This modification contradicts the underlying philosophy of Ciecam. If you want to keep the Auto-Matched Tone Curve, it is better to use the Standard mode.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Exposure module, and in particular ‘Exposure compensation’?===&lt;br /&gt;
The answer is: with reservations.&lt;br /&gt;
In the case of images of type a), b) or c), the Exposure slider will bring about a linear change in exposure (in Ev), increasing (or reducing) shadows and highlights in the same way. The ‘Highlight compression’ and Blacks sliders can be used to mitigate this but the adjustment is not very intuitive and can conflict with the TRC Gamma/Slope adjustments. An alternative is to use the Tone Equalizer (in the main menu or in Selective Editing), which allows progressive differentiation of highlights and shadows.&lt;br /&gt;
&lt;br /&gt;
===Tone-mapping modules - description and use===&lt;br /&gt;
I'll only focus on the modules using Black Ev, White Ev and ‘Mean Luminance (Yb%) Scene’. For the other Rawtherapee tone mapping modules are concerned:&lt;br /&gt;
* Tone Mapping is more a module for significantly modifying the local contrast (texture) than for carrying out a true tone mapping.&lt;br /&gt;
* Dynamic Range Compression uses a Laplacian and a Fourier transform. Its performance is OK, but it is slow and consumes a lot of resources.&lt;br /&gt;
* Note that most images - even with modern cameras - are limited to 14 or 15 Ev. HDR software that produces a DNG image from several bracketed images should be able to reach around 20 Ev.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_Selective_Editing | An evaluation of the dynamic-range capabilities of tools in Selective_Editing]]&lt;br /&gt;
&lt;br /&gt;
====The principle of calculating Dynamic Range (DR)====&lt;br /&gt;
Three algorithms use the concepts associated with Dynamic Range i.e. Black Ev, White Ev and ‘Mean Luminance (Yb) scene’ (a concept close to that of middle grey).&lt;br /&gt;
* Log Encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma-based and Slope-based highlight roll-off (my favourite).&lt;br /&gt;
&lt;br /&gt;
How are these values assessed? It's a difficult exercise, because it involves finding the blackest point (black point), the whitest point (white point) and the average grey value (Yb%) on an unprocessed image. We use a fairly empirical and approximate formula evaluates these 3 data points, which are then used by the 3 algorithms mentioned.&lt;br /&gt;
* The first question is: ‘What data are we using and at what stage in the processing pipeline? Rawtherapee uses the data just after white balance and after conversion to the Working Profile (except for Sigmoid Q and Slope-based Q which are incorporated into the Cam16 process).&lt;br /&gt;
* The second question is: ‘Are these values representative of reality? It’s not sure because in particular:&lt;br /&gt;
** We don't know how the blacks near the black point and whites near the white point are mapped,&lt;br /&gt;
** The value of middle grey is, on the one hand, marred by approximations and on the other, Ciecam takes into account the luminance of the background Yb%, and not the luminance of the whole image.&lt;br /&gt;
** Rather than playing empirically with the 3 parameters Black Ev, White Ev, ‘Mean luminance (Yb%) Scene’ , this led me to base the action on the distribution of blacks and whites, this action having an effect on the value of ‘Mean Luminance (Yb%) Scene’. By default, ‘White distribution’ is set to 20 to take account of Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====How do we use the three values of  Black Ev, White Ev and ‘Mean luminance (Yb %) Scene’.? ====&lt;br /&gt;
* Log Encoding calculates a logarithmic base from the Black Ev scene value, the dynamic range and the ‘Mean Luminance (Yb%)’ viewing value. This logarithmic conversion is applied to all the data to be processed. It seems clear that the processing here is anything but linear. Depending on the image, the result will sometimes be an excess of shadow enhancement and highlight attenuation compared to the average highlights. In addition, this conversion can profoundly modify the colorimetry. For Log Encoding, the algorithm in Rawtherapee only allows simple colour corrections (saturation, brightness compression). The advantage of this algorithm is that it can handle a very high dynamic range.&lt;br /&gt;
* Sigmoid, as its name suggests, uses a mathematical sigmoid based on 3 main concepts: a) an asymptotic attenuation (especially for whites) giving highlights a more natural appearance; b) a variable slope of the sigmoid acurve cting on overall contrast; c) a shift (skew) of the sigmoid so that the action is primarily on highlights or shadows (you can't have both). The advantage of this algorithm is its apparent simplicity, and it works very well on images that are not too difficult. &lt;br /&gt;
** Simulation: I'm attaching a demonstration of a Sigmoid curve with 2 parameters where ‘L’ corresponds to ‘Contrast’ and ‘t’ corresponds to ‘Skew’. Note that the calculation performed in the code is slightly different. This simulation is for demonstration purposes only.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* The Gamma-based and Slope-based functions both use Freeman's tone-mapping algorithm. Gamma-based only uses the asymptotic function to give highlights a more natural appearance. Slope-based adds the low and mid tones. Its principle is somewhat different from that of Sigmoid and is similar to that of a TRC (the processing of the shadows not being strictly linear). The advantage of this algorithm is its simplicity; it enables effective treatment of the attenuation of highlights and also allows you to act on the overall contrast.&lt;br /&gt;
** You also have the choice of ‘RGB channel Slope’, which is partly similar to RGB Curves, allowing differentiated action on the three R, G and B channels. Compared with Slope-based, a number of settings have been added to make full use of Freeman's algorithm: &lt;br /&gt;
*** Dynamic range (DR) is taken into account for the Viewing value of Yb % in addition to the Scene value,&lt;br /&gt;
*** Luminosity mode to try and preserve luminance (similar to RGB curves) - this mode can lead to strong artefacts,&lt;br /&gt;
*** Attenuation threshold associated with the ‘Highlight attenuation only’ choice to modulate the start of the action on highlights (normally from the Yb % Scene value).    &lt;br /&gt;
&lt;br /&gt;
In all 3 cases (Log Encoding, Sigmoid and the Freeman algorithm) we use the Scene (source) data to make it fit into a useful range that is consistent with our own visual capabilities and those of the peripheral (screens, etc.).&lt;br /&gt;
This useful range is also a source of debate: a) should we use relative luminance for the output peripherals or absolute luminance with the notions of Peak and ‘Diffuse white’ for luminance; b) our eye-brain pairing has much better performance than any peripheral and takes into account other physiological parameters (Ciecam).&lt;br /&gt;
The Cam16 (Selective Editing) module tries to take all these parameters into account (as much as possible).&lt;br /&gt;
&lt;br /&gt;
* The case of Sigmoid Q and Slope based Q: I wanted to integrate the 2 Sigmoid and Slope based algorithms into Cam16's Q (Absolute luminance) loop (which has 6 variables). It's clear that we are no longer upstream of the process, but in the process. In particular, the Scene value of Yb% (middle grey) is profoundly modified by Ciecam. I've therefore applied an average empirical correction coefficient. These 2 algorithms should be seen more as personal challenges than as real alternatives.&lt;br /&gt;
====How do I use these tone-mapping algorithms? ====&lt;br /&gt;
* These tone-mapping algorithms can be described as semi-automatic, because the parameters used – Black Ev, White Ev and the Scene value of ‘Mean Luminance (Yb%)’ - are automatically pre-calculated. The values to be adjusted for Sigmoid or Slope-based are close to the default values.&lt;br /&gt;
* Log encoding can be used as a first step, and the TRC (using Gamma, Slope and Midtones) or even Sigmoid can be used as a complement.&lt;br /&gt;
* For the other cases (the majority), I recommend starting the process with TRC (gamma, slope, midtones) and attenuating the highlights either with ‘Ev- based’ or ‘Gamma-based’. If you want to increase the overall contrast you can activate ‘Slope-based’ or Sigmoid.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Local Contrast===&lt;br /&gt;
As I said earlier, I think it's better to use a moderate amount of overall contrast to highlight the main subject (flowers, buildings, animals, etc.) and then add some local contrast. This can take 2 forms:&lt;br /&gt;
* Either by using a guided-filter type algorithm (incorporated into Cam16) for small adjustments,&lt;br /&gt;
* Or by using variable local contrast  using wavelets. &lt;br /&gt;
** In the Abstract Profile module you have Contrast Enhancement based on the notion of contrast profiles.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* In Selective Editing, there is the Local Contrast &amp;amp; Wavelets tool, which in Basic mode allows you to adjust the local contrast (by choosing the appropriate range of decomposition levels) along with a Clarity function.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10817</id>
		<title>Toolchain Pipeline</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10817"/>
		<updated>2024-08-27T10:52:03Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Tone-mapping modules - description and use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Toolchain Pipeline and Colorimetry&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Toolchain Pipeline ==&lt;br /&gt;
&lt;br /&gt;
=== Processing Order ===&lt;br /&gt;
&lt;br /&gt;
Everything that happens to an image, from the moment you open the file to the moment it is displayed on screen or saved, takes place in a fixed order. The data flows from one module to another - this is the toolchain pipeline. RawTherapee contains four pipelines (one for the main preview, one for the saved image, one for the thumbnail, and one other that currently escaped me). The following list shows a simplified order of operations:&lt;br /&gt;
&lt;br /&gt;
# Preprocess&lt;br /&gt;
## Dark frame&lt;br /&gt;
## Flat field&lt;br /&gt;
## Bad pixels&lt;br /&gt;
## Hot pixels&lt;br /&gt;
## Scale colors (internal, no tool in UI)&lt;br /&gt;
## Raw black point&lt;br /&gt;
## Lens distortion correction&lt;br /&gt;
## Green equilibration&lt;br /&gt;
## Line noise filter&lt;br /&gt;
## Chromatic aberration Correction&lt;br /&gt;
## Raw white point&lt;br /&gt;
## Raw histogram&lt;br /&gt;
## Prepare Auto Exposure&lt;br /&gt;
# Demosaic&lt;br /&gt;
# Retinex&lt;br /&gt;
# Highlight recovery&lt;br /&gt;
# White balance&lt;br /&gt;
# Spot Removal&lt;br /&gt;
# Crop&lt;br /&gt;
# Convert colorspace&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Dehaze&lt;br /&gt;
# Dynamic range compression&lt;br /&gt;
# (Local Adjustments branch) avoid color shift, Log encoding, blur-noise denoise, tone-mapping, dehaze &amp;amp; retinex, contrast by detail levels, vibrance, soflight, local contrast, wavelet, sharp, exposure, color and light, Color appearance (Cam16 &amp;amp; JzCzhz), avoid color shift&lt;br /&gt;
# Auto-match tone curve&lt;br /&gt;
# Tone response curve&lt;br /&gt;
# Process RGB&lt;br /&gt;
## Channel mixer&lt;br /&gt;
## Tone curve&lt;br /&gt;
## Highlights&lt;br /&gt;
## Shadows&lt;br /&gt;
## RGB curves&lt;br /&gt;
## HSV curves&lt;br /&gt;
## Color toning&lt;br /&gt;
## Film simulation&lt;br /&gt;
## Black-and-white&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
# Process Lab&lt;br /&gt;
## Shadows/Highlight (Lab)&lt;br /&gt;
## Local contrast (Lab)&lt;br /&gt;
## Lab adjustements&lt;br /&gt;
## Vibrance&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
## Vignette filter&lt;br /&gt;
## Graduated filter&lt;br /&gt;
## Tone mapping&lt;br /&gt;
## Impulse noise reduction&lt;br /&gt;
## Defringe&lt;br /&gt;
## Edges&lt;br /&gt;
## Microcontrast&lt;br /&gt;
## Sharpening&lt;br /&gt;
## Contrast by Detail Levels&lt;br /&gt;
## Wavelets&lt;br /&gt;
## Soft light&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Resize&lt;br /&gt;
## Post-resize sharpening&lt;br /&gt;
# Final Lab -&amp;gt; RGB conversion&lt;br /&gt;
&lt;br /&gt;
=== List of All Tools in RawTherapee ===&lt;br /&gt;
&lt;br /&gt;
* Generic/Main preview&lt;br /&gt;
** Input profile&lt;br /&gt;
** Monitor Color Profile&lt;br /&gt;
** Working profile&lt;br /&gt;
** Output profile&lt;br /&gt;
** Clipping indication&lt;br /&gt;
** Red/Green/Blue/Luminosity/Focus mask previews&lt;br /&gt;
** Colorimetric intent&lt;br /&gt;
* Exposure Tab&lt;br /&gt;
** Exposure&lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Mapping&lt;br /&gt;
** Dynamic Range Compression&lt;br /&gt;
** Vignette Filter&lt;br /&gt;
** Graduated Filter&lt;br /&gt;
** Lab Adjustments&lt;br /&gt;
* Detail Tab&lt;br /&gt;
** Sharpening&lt;br /&gt;
** Local Contrast&lt;br /&gt;
** Edges&lt;br /&gt;
** Microcontrast&lt;br /&gt;
** Impulse Noise Reduction&lt;br /&gt;
** Noise Reduction&lt;br /&gt;
** Defringe&lt;br /&gt;
** Contrast by Detail Levels&lt;br /&gt;
** Haze Removal&lt;br /&gt;
* Color Tab&lt;br /&gt;
** White Balance&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Channel Mixer&lt;br /&gt;
** Black-and-White&lt;br /&gt;
** HSV Equalizer&lt;br /&gt;
** Film Simulation&lt;br /&gt;
** Soft Light&lt;br /&gt;
** RGB Curves&lt;br /&gt;
** Color Toning&lt;br /&gt;
** Color Management&lt;br /&gt;
* Advanced Tab&lt;br /&gt;
** Retinex&lt;br /&gt;
** CIE Color Appearance Model 2002&lt;br /&gt;
** Wavelet Levels&lt;br /&gt;
* Transform Tab&lt;br /&gt;
** Crop&lt;br /&gt;
** Resize&lt;br /&gt;
** Lens/Geometry&lt;br /&gt;
*** Rotate&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profiled Lens Correction&lt;br /&gt;
*** Distortion Correction&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
*** Vignetting Correction&lt;br /&gt;
* Raw Tab&lt;br /&gt;
** Sensor with Bayer matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
*** Preprocessing&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
** Sensor with X-Trans matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
** Raw White Points&lt;br /&gt;
** Preprocessing&lt;br /&gt;
** Dark Frame&lt;br /&gt;
** Flat-Field&lt;br /&gt;
** Film Negative&lt;br /&gt;
** Capture Sharpening&lt;br /&gt;
&lt;br /&gt;
== Colorimetry ==&lt;br /&gt;
&lt;br /&gt;
=== The Importance of CIECAM and L*a*b* ===&lt;br /&gt;
&lt;br /&gt;
Colorimetry gives rise to a lot of debate but we have to remember that it is not an exact science. No amount of equations, however complex, can ensure that the human eye will necessarily be satisfied with an image. &lt;br /&gt;
&lt;br /&gt;
Currently RawTherapee uses the L*a*b* color space and CIECAM02/16 for chromatic adaptation and work has begun on exploring other color spaces (Jzazbz) and CAM models, for HDR applications (ZCAM does not work)..&lt;br /&gt;
 &lt;br /&gt;
The use of the L*a*b* (or CIELAB) color space does have its limitations but many of its shortcomings can be successfully mitigated, at least for SDR applications.&lt;br /&gt;
 &lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* One of the most frequent criticisms is that L*a*b* is non-linear and that it &amp;quot;distorts&amp;quot; the colors, in particular for blue-violet and red-orange. This is certainly true if you simply adjust the image using curves or chromaticity sliders. However in RawTherapee, if you click on &amp;quot;Avoid color shift&amp;quot; (Munsell correction), nearly 200 LUTs will correct these shifts and make the image perfectly linear. &lt;br /&gt;
* It is also said that L*a*b* addresses imaginary colors if the working profile allows it. This is also true but again, this can be compensated in RawTherapee by enabling &amp;quot;Avoid color shift&amp;quot;. In this case, a relative colorimetric correction is applied to the working gamut as follows:  &lt;br /&gt;
** It analyzes the image data.&lt;br /&gt;
** If it is within gamut no action is taken.&lt;br /&gt;
** If it is outside gamut,the chroma is reduced and if this is insufficient, or if it is close to L=0 or L=100, then L is adjusted.&lt;br /&gt;
** You can also choose the algorithm developed by Emil Martinec (gamutmap) which provides XYZ control (absolute or relative).&lt;br /&gt;
** However this should rarely occur if Prophoto is used in the Working Profile and is probably not important.&lt;br /&gt;
** If the saturation has been adjusted (chroma, vibrance,…), a Munsell correction using nearly 200 LUTs is applied. This will correct any color shifts with a high degree of accuracy e.g a red that has turned orange because of L*a*b*, will become red again. There will still be some errors but they are very small.&lt;br /&gt;
** The Munsell correction is applied in all cases unless none is selected.&lt;br /&gt;
&lt;br /&gt;
==== L*a*b* ====&lt;br /&gt;
&lt;br /&gt;
*  L*a*b* is a reversible transformation of XYZ (in simplified terms, Y is transformed into L* using a gamma of 3.0 and a slope of 9.03). L*a*b* has more or less the same characteristics in terms of its limits (those of the primaries) as XYZ, which serves as a reference for the Working Profile and determines the basis of the gamut. Therefore L*a*b* and XYZ have essentially the same characteristics (exposure range, gamut, etc.). One point however, in many processes the values of L* can be bounded (clipped), to limit artifacts (high contrasts, highlights...), but in most cases L* is unbounded. If we ever get to HDR processing, we'll probably have to switch to &amp;quot;HDR-Lab&amp;quot;. The data is not lost, even for high-dynamic range images (&amp;gt;= 25Ev), but the progression in the highlights is not progressive enough when used with monitors capable of displaying luminance values in the range of 120 cd/m² and beyond.&lt;br /&gt;
* I don’t think that the RGB-&amp;gt;Lab transformation itself prevents complete HDR processing. This is because the calculations are generally carried out using ‘float’ or ‘double’ data values (32 or 64 bits) or using SSE (128 bit - 4x32 or 2x64 bits). The linear part of the Lab transform allows shadows with values of 0.005 cd/m2 or less to be processed. The parabolic part (gamma = 3.0) limits the distribution of data in the highlights allowing them to be reproduced more accurately (on suitable monitors) with luminance values above 120 cd/m2. The XYZ&amp;lt;=&amp;gt;Lab conversion leads to hardly any loss of data (insignificant due to double conversions) and can be considered as a kind of lossless compression. Of course if we want to achieve complete HDR processing, it is necessary to ensure that the way the data is processed, prior to being sent to the monitor, allows for more progression in the highlights. The preferred approach for Rawtherapee would be to implement HDR-Lab instead of Lab. But in the meantime I have implemented the possibility of changing the gamma of Lab (3.0) for several tools (wavelets, tone-mapping, etc.) notably to make it linear. It should be noted that Rawtherapee is designed to overcome one of the problems with Lab, which is the non-preservation of the hue when the saturation changes (especially in oranges and purples), by using &amp;quot;Perceptual Uniform Lab&amp;quot;. This involves using a series of Munsell LUTs, as well as gamut control to prevent virtual colors.&lt;br /&gt;
&lt;br /&gt;
====L*a*b* does not impact the gamut or the dynamic range of high-dynamic-range images as shown in the following example with a Dynamic Range of 25Ev====&lt;br /&gt;
Note that the majority of digital cameras in 2024 have a maximum dynamic range of about 15Ev. This image is therefore exceptional but demonstrates the behavior of Lab* for images with a high dynamic range.&lt;br /&gt;
&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of L*a*b* does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
==== CIECAM02/16 ====&lt;br /&gt;
&lt;br /&gt;
* One criticism of Ciecam02 is that is not able to process high dynamic range and wide color gamut images, which is partially true. A number of improvements were made by the development team a few years ago to mitigate this problem (bearing in mind that a large number of user images fall within the sRGB gamut and do not pose a problem). However, by using Log Encoding in conjunction with Cam16, or Color appearance (Cam16 &amp;amp; JzCzHz), the vast majority of problems can be solved. Of course some images will still present problems, in particular with highlight reconstruction, but this is not specific to Ciecam. The addition of Ciecam16 (Cam16) solves some of these problems.&lt;br /&gt;
* Ciecam02/16 is one of the only ways to achieve true colorimetric correction because it takes into account human perception and the surrounding environment. With Ciecam for example, any adjustments to the luminosity and/or the saturation, will take into account the image and its environment.&lt;br /&gt;
&lt;br /&gt;
==== White Balance ====&lt;br /&gt;
&lt;br /&gt;
* White balance is also subject to debate. The Temperature Correlation module recently introduced in Rawtherapee is almost mathematically (cognitively) perfect. It makes the xyY colors of the image coincide with known spectral data. However, on images where the temperature deviates a long way from D50, the colorimetry will not be correct because there will not be the necessary chromatic adaptation expected by our eyes and brain. Ciecam however, can take this into account.&lt;br /&gt;
&lt;br /&gt;
=== Importance of the Linear-RGB Model and Colorimetry ===&lt;br /&gt;
&lt;br /&gt;
The merits of the RGB model, and in particular, the linear RGB model are frequently cited. It is certainly the best way to carry out “upstream” processing (demosaicing, white balance, defringing, chromatic aberration correction, etc.) and anything that can be done in this mode should be.&lt;br /&gt;
&lt;br /&gt;
However, CIELAB and Ciecam02/16 still have their place despite their shortcomings. As we have seen above, they are both derived from the CIE XYZ tristimulus values with Ciecam being one of the only ways to achieve true colorimetric correction.&lt;br /&gt;
&lt;br /&gt;
So what about tone curves?&lt;br /&gt;
&lt;br /&gt;
* Not only are they non-linear but they only provide limited colorimetric compensation, if any (with the exception of the Perceptual mode, which uses Ciecam02). This is in contrast to the Tone Response Curves -TRC- used for output (monitor, TIF etc.).&lt;br /&gt;
* The Auto-Matched Tone Curve, which is a copy of the in-camera TRC, is applied mid-process and introduces non-linearities in the processing pipeline.&lt;br /&gt;
&lt;br /&gt;
What about saturation?&lt;br /&gt;
&lt;br /&gt;
* Maintaining RGB linearity when you change the saturation is not impossible but it is difficult and is not implemented in Rawtherapee. On the other hand, if you adjust the saturation using Ciecam, it will take into account variations in luminance (or brightness) and adapt the color accordingly.&lt;br /&gt;
&lt;br /&gt;
In conclusion, RGB, L *a *b *, and Ciecam all have their advantages and disadvantages. They simply need to be understood so that they can be used appropriately.&lt;br /&gt;
&lt;br /&gt;
===What are the acceptable principles for processing SDR or HDR images?===&lt;br /&gt;
The argument below is partly based on the fact that Rawtherapee has two Ciecam modules, one located at the end of the main process (Color Appearance &amp;amp; Lighting), the other in Selective Editing, Color Appearance (Cam16) located just after white balance. These 2 modules are Color Appearance Models (CAMs) and contain all the processes and tools needed to ensure good colorimetry. However, these 2 modules alone are not always able to process:&lt;br /&gt;
a) images with a very high dynamic range, &lt;br /&gt;
b) images with very pronounced shadows, &lt;br /&gt;
c) images with strong highlights (not to be confused with highlight reconstruction).&lt;br /&gt;
&lt;br /&gt;
The science of colour matching is often inexact and imprecise. Nevertheless, as we have seen, the most linear treatment possible seems to be recommended if practicable. However, this seems impossible if the differences linked to a) b) c) above are significant. &lt;br /&gt;
In these cases, I propose as a first step a principle close to that of the rendering of human vision: a linear part (slope) to ‘unblock’ the shadows and a parabolic part (gamma) to render the perception of medium tones and highlights fairly similar to that of our eye/brain pair. This linear/parabolic differentiation is commonly used in various software applications e.g., sRGB gamma where Slope =12.92 and Gamma=2.4, or BT709 where slope=4.5 and Gamma=2.22 or ‘Lab’ where Slope=9.03 and Gamma=3.0.&lt;br /&gt;
The two Tone Response Curve (TRC) modules present in the Abstract Profile module or in Selective Editing &amp;gt; Color Appearance &amp;gt; Source Data Adjustments provide a partial response to the problems described in a) and b), by allowing adjustments to be carried out with higher Slope and Gamma values.&lt;br /&gt;
&lt;br /&gt;
The problem of reducing highlights, improving overall contrast and using local contrast still remains and will be discussed below.&lt;br /&gt;
&lt;br /&gt;
Don't forget that Cam16 is a processing module in its own right. You can use it to process images using tools such as:&lt;br /&gt;
* Surround or Scene conditions ( average, dim, dark etc.) which allows you to take dark or very dark backgrounds into account. This algorithm alone can provide shadow enhancement in certain images.&lt;br /&gt;
*Lightness, Brightness (and their corresponding contrast parameters), Chroma, Saturation, Colorfulness, etc.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above, colorimetry is not an exact science so you should use whichever tools give a result that is pleasing to your eye. &lt;br /&gt;
&lt;br /&gt;
===How useful are ICC and DCP input profiles ? ===&lt;br /&gt;
Raw files are generally decoded using a matrix (from Adobe) called ‘Color Matrix1’ based on the D65 illuminant. This matrix is sufficient in the vast majority of cases.&lt;br /&gt;
It can be replaced by either an ICC profile or a DCP profile that has been developed either by the user, using a Colorchecker24 for example, or supplied by Rawtherapee or Adobe.&lt;br /&gt;
There are two broad problems with these sorts of profiles:&lt;br /&gt;
* The Colorchecker24 is limited (with one exception in blues) to the sRGB gamut. What happens when such a profile is used, for example, on images of flowers or minerals where the gamut is much larger?&lt;br /&gt;
* The profile is only really relevant for a given illuminant. What happens when a profile developed for D50 (daylight in the sun) is used in the shade? It is true that DCP profiles have an interpolation table between D65 and Tungsten 2850K, but this is still approximate.&lt;br /&gt;
My point is not to say that you shouldn’t use these profiles, which are very useful for reproducing paintings, coins, etc. in controlled lighting, but to show their limitations.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Auto-Matched Tone Curve?===&lt;br /&gt;
The answer is: maybe? &lt;br /&gt;
This curve generated from the JPEG attached to the Raw reproduces the colourimetry of the camera manufacturer (Canon, Nikon, Sony, etc.). This is a criterion of choice, but it has a few constraints:&lt;br /&gt;
* The generated curve can lead to an increase in contrast which, depending on the image, may cause clipping in the shadows and highlights. In many cases, this increase in contrast is undesirable.&lt;br /&gt;
* The default choice of ‘Film-like’ modifies the colorimetry. This modification contradicts the underlying philosophy of Ciecam. If you want to keep the Auto-Matched Tone Curve, it is better to use the Standard mode.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Exposure module, and in particular ‘Exposure compensation’?===&lt;br /&gt;
The answer is: with reservations.&lt;br /&gt;
In the case of images of type a), b) or c), the Exposure slider will bring about a linear change in exposure (in Ev), increasing (or reducing) shadows and highlights in the same way. The ‘Highlight compression’ and Blacks sliders can be used to mitigate this but the adjustment is not very intuitive and can conflict with the TRC Gamma/Slope adjustments. An alternative is to use the Tone Equalizer (in the main menu or in Selective Editing), which allows progressive differentiation of highlights and shadows.&lt;br /&gt;
&lt;br /&gt;
===Tone-mapping modules - description and use===&lt;br /&gt;
I'll only focus on the modules using Black Ev, White Ev and ‘Mean Luminance (Yb%) Scene’. For the other Rawtherapee tone mapping modules are concerned:&lt;br /&gt;
* Tone Mapping is more a module for significantly modifying the local contrast (texture) than for carrying out a true tone mapping.&lt;br /&gt;
* Dynamic Range Compression uses a Laplacian and a Fourier transform. Its performance is OK, but it is slow and consumes a lot of resources.&lt;br /&gt;
* Note that most images - even with modern cameras - are limited to 14 or 15 Ev. HDR software that produces a DNG image from several bracketed images should be able to reach around 20 Ev.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_Selective_Editing | An evaluation of the dynamic-range capabilities of tools in Selective_Editing]]&lt;br /&gt;
&lt;br /&gt;
====The principle of calculating Dynamic Range (DR)====&lt;br /&gt;
Three algorithms use the concepts associated with Dynamic Range i.e. Black Ev, White Ev and ‘Mean Luminance (Yb) scene’ (a concept close to that of middle grey).&lt;br /&gt;
* Log Encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma-based and Slope-based highlight roll-off (my favourite).&lt;br /&gt;
&lt;br /&gt;
How are these values assessed? It's a difficult exercise, because it involves finding the blackest point (black point), the whitest point (white point) and the average grey value (Yb%) on an unprocessed image. We use a fairly empirical and approximate formula evaluates these 3 data points, which are then used by the 3 algorithms mentioned.&lt;br /&gt;
* The first question is: ‘What data are we using and at what stage in the processing pipeline? Rawtherapee uses the data just after white balance and after conversion to the Working Profile (except for Sigmoid Q and Slope-based Q which are incorporated into the Cam16 process).&lt;br /&gt;
* The second question is: ‘Are these values representative of reality? It’s not sure because in particular:&lt;br /&gt;
** We don't know how the blacks near the black point and whites near the white point are mapped,&lt;br /&gt;
** The value of middle grey is, on the one hand, marred by approximations and on the other, Ciecam takes into account the luminance of the background Yb%, and not the luminance of the whole image.&lt;br /&gt;
** Rather than playing empirically with the 3 parameters Black Ev, White Ev, ‘Mean luminance (Yb%) Scene’ , this led me to base the action on the distribution of blacks and whites, this action having an effect on the value of ‘Mean Luminance (Yb%) Scene’. By default, ‘White distribution’ is set to 20 to take account of Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====How do we use the three values of  Black Ev, White Ev and ‘Mean luminance (Yb %) Scene’.? ====&lt;br /&gt;
* Log Encoding calculates a logarithmic base from the Black Ev scene value, the dynamic range and the ‘Mean Luminance (Yb%)’ viewing value. This logarithmic conversion is applied to all the data to be processed. It seems clear that the processing here is anything but linear. Depending on the image, the result will sometimes be an excess of shadow enhancement and highlight attenuation compared to the average highlights. In addition, this conversion can profoundly modify the colorimetry. For Log Encoding, the algorithm in Rawtherapee only allows simple colour corrections (saturation, brightness compression). The advantage of this algorithm is that it can handle a very high dynamic range.&lt;br /&gt;
* Sigmoid, as its name suggests, uses a mathematical sigmoid based on 3 main concepts: a) an asymptotic attenuation (especially for whites) giving highlights a more natural appearance; b) a variable slope of the sigmoid acurve cting on overall contrast; c) a shift (skew) of the sigmoid so that the action is primarily on highlights or shadows (you can't have both). The advantage of this algorithm is its apparent simplicity, and it works very well on images that are not too difficult. &lt;br /&gt;
** Simulation: I'm attaching a demonstration of a Sigmoid curve with 2 parameters where ‘L’ corresponds to ‘Contrast’ and ‘t’ corresponds to ‘Skew’. Note that the calculation performed in the code is slightly different. This simulation is for demonstration purposes only.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* The Gamma-based and Slope-based functions both use Freeman's tone-mapping algorithm. Gamma-based only uses the asymptotic function to give highlights a more natural appearance. Slope-based adds the low and mid tones. Its principle is somewhat different from that of Sigmoid and is similar to that of a TRC (the processing of the shadows not being strictly linear). The advantage of this algorithm is its simplicity; it enables effective treatment of the attenuation of highlights and also allows you to act on the overall contrast.&lt;br /&gt;
** You also have the choice of ‘RGB channel Slope’, which is partly similar to RGB Curves, allowing differentiated action on the three R, G and B channels. Compared with Slope-based, a number of settings have been added to make full use of Freeman's algorithm: &lt;br /&gt;
*** Dynamic range (DR) is taken into account for the Viewing value of Yb % in addition to the Scene value,&lt;br /&gt;
*** Luminosity mode to try and preserve luminance (similar to RGB curves) - this mode can lead to strong artefacts,&lt;br /&gt;
*** Attenuation threshold associated with the ‘Highlight attenuation only’ choice to modulate the start of the action on highlights (normally from the Yb % Scene value).    &lt;br /&gt;
&lt;br /&gt;
In all 3 cases (Log Encoding, Sigmoid and the Freeman algorithm) we use the Scene (source) data to make it fit into a useful range that is consistent with our own visual capabilities and those of the peripheral (screens, etc.).&lt;br /&gt;
This useful range is also a source of debate: a) should we use relative luminance for the output peripherals or absolute luminance with the notions of Peak and ‘Diffuse white’ for luminance; b) our eye-brain pairing has much better performance than any peripheral and takes into account other physiological parameters (Ciecam).&lt;br /&gt;
The Cam16 (Selective Editing) module tries to take all these parameters into account (as much as possible).&lt;br /&gt;
&lt;br /&gt;
* The case of Sigmoid Q and Slope based Q: I wanted to integrate the 2 Sigmoid and Slope based algorithms into Cam16's Q (Absolute luminance) loop (which has 6 variables). It's clear that we are no longer upstream of the process, but in the process. In particular, the Scene value of Yb% (middle grey) is profoundly modified by Ciecam. I've therefore applied an average empirical correction coefficient. These 2 algorithms should be seen more as personal challenges than as real alternatives.&lt;br /&gt;
====How do I use these tone-mapping algorithms? ====&lt;br /&gt;
* These tone-mapping algorithms can be described as semi-automatic, because the parameters used – Black Ev, White Ev and the Scene value of ‘Mean Luminance (Yb%)’ - are automatically pre-calculated. The values to be adjusted for Sigmoid or Slope-based are close to the default values.&lt;br /&gt;
* Log encoding can be used as a first step, and the TRC (using Gamma, Slope and Midtones) or even Sigmoid can be used as a complement.&lt;br /&gt;
* For the other cases (the majority), I recommend starting the process with TRC (gamma, slope, midtones) and attenuating the highlights either with ‘Ev- based’ or ‘Gamma-based’. If you want to increase the overall contrast you can activate ‘Slope-based’ or Sigmoid.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Local Contrast===&lt;br /&gt;
As I said earlier, I think it's better to use a moderate amount of overall contrast to highlight the main subject (flowers, buildings, animals, etc.) and then add some local contrast. This can take 2 forms:&lt;br /&gt;
* Either by using a guided-filter type algorithm (incorporated into Cam16) for small adjustments,&lt;br /&gt;
* Or by using variable local contrast  using wavelets. &lt;br /&gt;
** In the Abstract Profile module you have Contrast Enhancement based on the notion of contrast profiles.&lt;br /&gt;
 [File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* In Selective Editing, there is the Local Contrast &amp;amp; Wavelets tool, which in Basic mode allows you to adjust the local contrast (by choosing the appropriate range of decomposition levels) along with a Clarity function.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10816</id>
		<title>Toolchain Pipeline</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10816"/>
		<updated>2024-08-27T10:51:34Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* How useful are ICC and DCP input profiles ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Toolchain Pipeline and Colorimetry&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Toolchain Pipeline ==&lt;br /&gt;
&lt;br /&gt;
=== Processing Order ===&lt;br /&gt;
&lt;br /&gt;
Everything that happens to an image, from the moment you open the file to the moment it is displayed on screen or saved, takes place in a fixed order. The data flows from one module to another - this is the toolchain pipeline. RawTherapee contains four pipelines (one for the main preview, one for the saved image, one for the thumbnail, and one other that currently escaped me). The following list shows a simplified order of operations:&lt;br /&gt;
&lt;br /&gt;
# Preprocess&lt;br /&gt;
## Dark frame&lt;br /&gt;
## Flat field&lt;br /&gt;
## Bad pixels&lt;br /&gt;
## Hot pixels&lt;br /&gt;
## Scale colors (internal, no tool in UI)&lt;br /&gt;
## Raw black point&lt;br /&gt;
## Lens distortion correction&lt;br /&gt;
## Green equilibration&lt;br /&gt;
## Line noise filter&lt;br /&gt;
## Chromatic aberration Correction&lt;br /&gt;
## Raw white point&lt;br /&gt;
## Raw histogram&lt;br /&gt;
## Prepare Auto Exposure&lt;br /&gt;
# Demosaic&lt;br /&gt;
# Retinex&lt;br /&gt;
# Highlight recovery&lt;br /&gt;
# White balance&lt;br /&gt;
# Spot Removal&lt;br /&gt;
# Crop&lt;br /&gt;
# Convert colorspace&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Dehaze&lt;br /&gt;
# Dynamic range compression&lt;br /&gt;
# (Local Adjustments branch) avoid color shift, Log encoding, blur-noise denoise, tone-mapping, dehaze &amp;amp; retinex, contrast by detail levels, vibrance, soflight, local contrast, wavelet, sharp, exposure, color and light, Color appearance (Cam16 &amp;amp; JzCzhz), avoid color shift&lt;br /&gt;
# Auto-match tone curve&lt;br /&gt;
# Tone response curve&lt;br /&gt;
# Process RGB&lt;br /&gt;
## Channel mixer&lt;br /&gt;
## Tone curve&lt;br /&gt;
## Highlights&lt;br /&gt;
## Shadows&lt;br /&gt;
## RGB curves&lt;br /&gt;
## HSV curves&lt;br /&gt;
## Color toning&lt;br /&gt;
## Film simulation&lt;br /&gt;
## Black-and-white&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
# Process Lab&lt;br /&gt;
## Shadows/Highlight (Lab)&lt;br /&gt;
## Local contrast (Lab)&lt;br /&gt;
## Lab adjustements&lt;br /&gt;
## Vibrance&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
## Vignette filter&lt;br /&gt;
## Graduated filter&lt;br /&gt;
## Tone mapping&lt;br /&gt;
## Impulse noise reduction&lt;br /&gt;
## Defringe&lt;br /&gt;
## Edges&lt;br /&gt;
## Microcontrast&lt;br /&gt;
## Sharpening&lt;br /&gt;
## Contrast by Detail Levels&lt;br /&gt;
## Wavelets&lt;br /&gt;
## Soft light&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Resize&lt;br /&gt;
## Post-resize sharpening&lt;br /&gt;
# Final Lab -&amp;gt; RGB conversion&lt;br /&gt;
&lt;br /&gt;
=== List of All Tools in RawTherapee ===&lt;br /&gt;
&lt;br /&gt;
* Generic/Main preview&lt;br /&gt;
** Input profile&lt;br /&gt;
** Monitor Color Profile&lt;br /&gt;
** Working profile&lt;br /&gt;
** Output profile&lt;br /&gt;
** Clipping indication&lt;br /&gt;
** Red/Green/Blue/Luminosity/Focus mask previews&lt;br /&gt;
** Colorimetric intent&lt;br /&gt;
* Exposure Tab&lt;br /&gt;
** Exposure&lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Mapping&lt;br /&gt;
** Dynamic Range Compression&lt;br /&gt;
** Vignette Filter&lt;br /&gt;
** Graduated Filter&lt;br /&gt;
** Lab Adjustments&lt;br /&gt;
* Detail Tab&lt;br /&gt;
** Sharpening&lt;br /&gt;
** Local Contrast&lt;br /&gt;
** Edges&lt;br /&gt;
** Microcontrast&lt;br /&gt;
** Impulse Noise Reduction&lt;br /&gt;
** Noise Reduction&lt;br /&gt;
** Defringe&lt;br /&gt;
** Contrast by Detail Levels&lt;br /&gt;
** Haze Removal&lt;br /&gt;
* Color Tab&lt;br /&gt;
** White Balance&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Channel Mixer&lt;br /&gt;
** Black-and-White&lt;br /&gt;
** HSV Equalizer&lt;br /&gt;
** Film Simulation&lt;br /&gt;
** Soft Light&lt;br /&gt;
** RGB Curves&lt;br /&gt;
** Color Toning&lt;br /&gt;
** Color Management&lt;br /&gt;
* Advanced Tab&lt;br /&gt;
** Retinex&lt;br /&gt;
** CIE Color Appearance Model 2002&lt;br /&gt;
** Wavelet Levels&lt;br /&gt;
* Transform Tab&lt;br /&gt;
** Crop&lt;br /&gt;
** Resize&lt;br /&gt;
** Lens/Geometry&lt;br /&gt;
*** Rotate&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profiled Lens Correction&lt;br /&gt;
*** Distortion Correction&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
*** Vignetting Correction&lt;br /&gt;
* Raw Tab&lt;br /&gt;
** Sensor with Bayer matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
*** Preprocessing&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
** Sensor with X-Trans matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
** Raw White Points&lt;br /&gt;
** Preprocessing&lt;br /&gt;
** Dark Frame&lt;br /&gt;
** Flat-Field&lt;br /&gt;
** Film Negative&lt;br /&gt;
** Capture Sharpening&lt;br /&gt;
&lt;br /&gt;
== Colorimetry ==&lt;br /&gt;
&lt;br /&gt;
=== The Importance of CIECAM and L*a*b* ===&lt;br /&gt;
&lt;br /&gt;
Colorimetry gives rise to a lot of debate but we have to remember that it is not an exact science. No amount of equations, however complex, can ensure that the human eye will necessarily be satisfied with an image. &lt;br /&gt;
&lt;br /&gt;
Currently RawTherapee uses the L*a*b* color space and CIECAM02/16 for chromatic adaptation and work has begun on exploring other color spaces (Jzazbz) and CAM models, for HDR applications (ZCAM does not work)..&lt;br /&gt;
 &lt;br /&gt;
The use of the L*a*b* (or CIELAB) color space does have its limitations but many of its shortcomings can be successfully mitigated, at least for SDR applications.&lt;br /&gt;
 &lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* One of the most frequent criticisms is that L*a*b* is non-linear and that it &amp;quot;distorts&amp;quot; the colors, in particular for blue-violet and red-orange. This is certainly true if you simply adjust the image using curves or chromaticity sliders. However in RawTherapee, if you click on &amp;quot;Avoid color shift&amp;quot; (Munsell correction), nearly 200 LUTs will correct these shifts and make the image perfectly linear. &lt;br /&gt;
* It is also said that L*a*b* addresses imaginary colors if the working profile allows it. This is also true but again, this can be compensated in RawTherapee by enabling &amp;quot;Avoid color shift&amp;quot;. In this case, a relative colorimetric correction is applied to the working gamut as follows:  &lt;br /&gt;
** It analyzes the image data.&lt;br /&gt;
** If it is within gamut no action is taken.&lt;br /&gt;
** If it is outside gamut,the chroma is reduced and if this is insufficient, or if it is close to L=0 or L=100, then L is adjusted.&lt;br /&gt;
** You can also choose the algorithm developed by Emil Martinec (gamutmap) which provides XYZ control (absolute or relative).&lt;br /&gt;
** However this should rarely occur if Prophoto is used in the Working Profile and is probably not important.&lt;br /&gt;
** If the saturation has been adjusted (chroma, vibrance,…), a Munsell correction using nearly 200 LUTs is applied. This will correct any color shifts with a high degree of accuracy e.g a red that has turned orange because of L*a*b*, will become red again. There will still be some errors but they are very small.&lt;br /&gt;
** The Munsell correction is applied in all cases unless none is selected.&lt;br /&gt;
&lt;br /&gt;
==== L*a*b* ====&lt;br /&gt;
&lt;br /&gt;
*  L*a*b* is a reversible transformation of XYZ (in simplified terms, Y is transformed into L* using a gamma of 3.0 and a slope of 9.03). L*a*b* has more or less the same characteristics in terms of its limits (those of the primaries) as XYZ, which serves as a reference for the Working Profile and determines the basis of the gamut. Therefore L*a*b* and XYZ have essentially the same characteristics (exposure range, gamut, etc.). One point however, in many processes the values of L* can be bounded (clipped), to limit artifacts (high contrasts, highlights...), but in most cases L* is unbounded. If we ever get to HDR processing, we'll probably have to switch to &amp;quot;HDR-Lab&amp;quot;. The data is not lost, even for high-dynamic range images (&amp;gt;= 25Ev), but the progression in the highlights is not progressive enough when used with monitors capable of displaying luminance values in the range of 120 cd/m² and beyond.&lt;br /&gt;
* I don’t think that the RGB-&amp;gt;Lab transformation itself prevents complete HDR processing. This is because the calculations are generally carried out using ‘float’ or ‘double’ data values (32 or 64 bits) or using SSE (128 bit - 4x32 or 2x64 bits). The linear part of the Lab transform allows shadows with values of 0.005 cd/m2 or less to be processed. The parabolic part (gamma = 3.0) limits the distribution of data in the highlights allowing them to be reproduced more accurately (on suitable monitors) with luminance values above 120 cd/m2. The XYZ&amp;lt;=&amp;gt;Lab conversion leads to hardly any loss of data (insignificant due to double conversions) and can be considered as a kind of lossless compression. Of course if we want to achieve complete HDR processing, it is necessary to ensure that the way the data is processed, prior to being sent to the monitor, allows for more progression in the highlights. The preferred approach for Rawtherapee would be to implement HDR-Lab instead of Lab. But in the meantime I have implemented the possibility of changing the gamma of Lab (3.0) for several tools (wavelets, tone-mapping, etc.) notably to make it linear. It should be noted that Rawtherapee is designed to overcome one of the problems with Lab, which is the non-preservation of the hue when the saturation changes (especially in oranges and purples), by using &amp;quot;Perceptual Uniform Lab&amp;quot;. This involves using a series of Munsell LUTs, as well as gamut control to prevent virtual colors.&lt;br /&gt;
&lt;br /&gt;
====L*a*b* does not impact the gamut or the dynamic range of high-dynamic-range images as shown in the following example with a Dynamic Range of 25Ev====&lt;br /&gt;
Note that the majority of digital cameras in 2024 have a maximum dynamic range of about 15Ev. This image is therefore exceptional but demonstrates the behavior of Lab* for images with a high dynamic range.&lt;br /&gt;
&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of L*a*b* does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
==== CIECAM02/16 ====&lt;br /&gt;
&lt;br /&gt;
* One criticism of Ciecam02 is that is not able to process high dynamic range and wide color gamut images, which is partially true. A number of improvements were made by the development team a few years ago to mitigate this problem (bearing in mind that a large number of user images fall within the sRGB gamut and do not pose a problem). However, by using Log Encoding in conjunction with Cam16, or Color appearance (Cam16 &amp;amp; JzCzHz), the vast majority of problems can be solved. Of course some images will still present problems, in particular with highlight reconstruction, but this is not specific to Ciecam. The addition of Ciecam16 (Cam16) solves some of these problems.&lt;br /&gt;
* Ciecam02/16 is one of the only ways to achieve true colorimetric correction because it takes into account human perception and the surrounding environment. With Ciecam for example, any adjustments to the luminosity and/or the saturation, will take into account the image and its environment.&lt;br /&gt;
&lt;br /&gt;
==== White Balance ====&lt;br /&gt;
&lt;br /&gt;
* White balance is also subject to debate. The Temperature Correlation module recently introduced in Rawtherapee is almost mathematically (cognitively) perfect. It makes the xyY colors of the image coincide with known spectral data. However, on images where the temperature deviates a long way from D50, the colorimetry will not be correct because there will not be the necessary chromatic adaptation expected by our eyes and brain. Ciecam however, can take this into account.&lt;br /&gt;
&lt;br /&gt;
=== Importance of the Linear-RGB Model and Colorimetry ===&lt;br /&gt;
&lt;br /&gt;
The merits of the RGB model, and in particular, the linear RGB model are frequently cited. It is certainly the best way to carry out “upstream” processing (demosaicing, white balance, defringing, chromatic aberration correction, etc.) and anything that can be done in this mode should be.&lt;br /&gt;
&lt;br /&gt;
However, CIELAB and Ciecam02/16 still have their place despite their shortcomings. As we have seen above, they are both derived from the CIE XYZ tristimulus values with Ciecam being one of the only ways to achieve true colorimetric correction.&lt;br /&gt;
&lt;br /&gt;
So what about tone curves?&lt;br /&gt;
&lt;br /&gt;
* Not only are they non-linear but they only provide limited colorimetric compensation, if any (with the exception of the Perceptual mode, which uses Ciecam02). This is in contrast to the Tone Response Curves -TRC- used for output (monitor, TIF etc.).&lt;br /&gt;
* The Auto-Matched Tone Curve, which is a copy of the in-camera TRC, is applied mid-process and introduces non-linearities in the processing pipeline.&lt;br /&gt;
&lt;br /&gt;
What about saturation?&lt;br /&gt;
&lt;br /&gt;
* Maintaining RGB linearity when you change the saturation is not impossible but it is difficult and is not implemented in Rawtherapee. On the other hand, if you adjust the saturation using Ciecam, it will take into account variations in luminance (or brightness) and adapt the color accordingly.&lt;br /&gt;
&lt;br /&gt;
In conclusion, RGB, L *a *b *, and Ciecam all have their advantages and disadvantages. They simply need to be understood so that they can be used appropriately.&lt;br /&gt;
&lt;br /&gt;
===What are the acceptable principles for processing SDR or HDR images?===&lt;br /&gt;
The argument below is partly based on the fact that Rawtherapee has two Ciecam modules, one located at the end of the main process (Color Appearance &amp;amp; Lighting), the other in Selective Editing, Color Appearance (Cam16) located just after white balance. These 2 modules are Color Appearance Models (CAMs) and contain all the processes and tools needed to ensure good colorimetry. However, these 2 modules alone are not always able to process:&lt;br /&gt;
a) images with a very high dynamic range, &lt;br /&gt;
b) images with very pronounced shadows, &lt;br /&gt;
c) images with strong highlights (not to be confused with highlight reconstruction).&lt;br /&gt;
&lt;br /&gt;
The science of colour matching is often inexact and imprecise. Nevertheless, as we have seen, the most linear treatment possible seems to be recommended if practicable. However, this seems impossible if the differences linked to a) b) c) above are significant. &lt;br /&gt;
In these cases, I propose as a first step a principle close to that of the rendering of human vision: a linear part (slope) to ‘unblock’ the shadows and a parabolic part (gamma) to render the perception of medium tones and highlights fairly similar to that of our eye/brain pair. This linear/parabolic differentiation is commonly used in various software applications e.g., sRGB gamma where Slope =12.92 and Gamma=2.4, or BT709 where slope=4.5 and Gamma=2.22 or ‘Lab’ where Slope=9.03 and Gamma=3.0.&lt;br /&gt;
The two Tone Response Curve (TRC) modules present in the Abstract Profile module or in Selective Editing &amp;gt; Color Appearance &amp;gt; Source Data Adjustments provide a partial response to the problems described in a) and b), by allowing adjustments to be carried out with higher Slope and Gamma values.&lt;br /&gt;
&lt;br /&gt;
The problem of reducing highlights, improving overall contrast and using local contrast still remains and will be discussed below.&lt;br /&gt;
&lt;br /&gt;
Don't forget that Cam16 is a processing module in its own right. You can use it to process images using tools such as:&lt;br /&gt;
* Surround or Scene conditions ( average, dim, dark etc.) which allows you to take dark or very dark backgrounds into account. This algorithm alone can provide shadow enhancement in certain images.&lt;br /&gt;
*Lightness, Brightness (and their corresponding contrast parameters), Chroma, Saturation, Colorfulness, etc.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above, colorimetry is not an exact science so you should use whichever tools give a result that is pleasing to your eye. &lt;br /&gt;
&lt;br /&gt;
===How useful are ICC and DCP input profiles ? ===&lt;br /&gt;
Raw files are generally decoded using a matrix (from Adobe) called ‘Color Matrix1’ based on the D65 illuminant. This matrix is sufficient in the vast majority of cases.&lt;br /&gt;
It can be replaced by either an ICC profile or a DCP profile that has been developed either by the user, using a Colorchecker24 for example, or supplied by Rawtherapee or Adobe.&lt;br /&gt;
There are two broad problems with these sorts of profiles:&lt;br /&gt;
* The Colorchecker24 is limited (with one exception in blues) to the sRGB gamut. What happens when such a profile is used, for example, on images of flowers or minerals where the gamut is much larger?&lt;br /&gt;
* The profile is only really relevant for a given illuminant. What happens when a profile developed for D50 (daylight in the sun) is used in the shade? It is true that DCP profiles have an interpolation table between D65 and Tungsten 2850K, but this is still approximate.&lt;br /&gt;
My point is not to say that you shouldn’t use these profiles, which are very useful for reproducing paintings, coins, etc. in controlled lighting, but to show their limitations.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Auto-Matched Tone Curve?===&lt;br /&gt;
The answer is: maybe? &lt;br /&gt;
This curve generated from the JPEG attached to the Raw reproduces the colourimetry of the camera manufacturer (Canon, Nikon, Sony, etc.). This is a criterion of choice, but it has a few constraints:&lt;br /&gt;
* The generated curve can lead to an increase in contrast which, depending on the image, may cause clipping in the shadows and highlights. In many cases, this increase in contrast is undesirable.&lt;br /&gt;
* The default choice of ‘Film-like’ modifies the colorimetry. This modification contradicts the underlying philosophy of Ciecam. If you want to keep the Auto-Matched Tone Curve, it is better to use the Standard mode.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Exposure module, and in particular ‘Exposure compensation’?===&lt;br /&gt;
The answer is: with reservations.&lt;br /&gt;
In the case of images of type a), b) or c), the Exposure slider will bring about a linear change in exposure (in Ev), increasing (or reducing) shadows and highlights in the same way. The ‘Highlight compression’ and Blacks sliders can be used to mitigate this but the adjustment is not very intuitive and can conflict with the TRC Gamma/Slope adjustments. An alternative is to use the Tone Equalizer (in the main menu or in Selective Editing), which allows progressive differentiation of highlights and shadows.&lt;br /&gt;
&lt;br /&gt;
===Tone-mapping modules - description and use===&lt;br /&gt;
I'll only focus on the modules using Black Ev, White Ev and ‘Mean Luminance (Yb%) Scene’. For the other Rawtherapee tone mapping modules are concerned:&lt;br /&gt;
* Tone Mapping is more a module for significantly modifying the local contrast (texture) than for carrying out a true tone mapping.&lt;br /&gt;
* Dynamic Range Compression uses a Laplacian and a Fourier transform. Its performance is OK, but it is slow and consumes a lot of resources.&lt;br /&gt;
* Note that most images - even with modern cameras - are limited to 14 or 15 Ev. HDR software that produces a DNG image from several bracketed images should be able to reach around 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)| Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
In english&lt;br /&gt;
[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_Selective_Editing | An evaluation of the dynamic-range capabilities of tools in Selective_Editing]]&lt;br /&gt;
&lt;br /&gt;
====The principle of calculating Dynamic Range (DR)====&lt;br /&gt;
Three algorithms use the concepts associated with Dynamic Range i.e. Black Ev, White Ev and ‘Mean Luminance (Yb) scene’ (a concept close to that of middle grey).&lt;br /&gt;
* Log Encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma-based and Slope-based highlight roll-off (my favourite).&lt;br /&gt;
&lt;br /&gt;
How are these values assessed? It's a difficult exercise, because it involves finding the blackest point (black point), the whitest point (white point) and the average grey value (Yb%) on an unprocessed image. We use a fairly empirical and approximate formula evaluates these 3 data points, which are then used by the 3 algorithms mentioned.&lt;br /&gt;
* The first question is: ‘What data are we using and at what stage in the processing pipeline? Rawtherapee uses the data just after white balance and after conversion to the Working Profile (except for Sigmoid Q and Slope-based Q which are incorporated into the Cam16 process).&lt;br /&gt;
* The second question is: ‘Are these values representative of reality? It’s not sure because in particular:&lt;br /&gt;
** We don't know how the blacks near the black point and whites near the white point are mapped,&lt;br /&gt;
** The value of middle grey is, on the one hand, marred by approximations and on the other, Ciecam takes into account the luminance of the background Yb%, and not the luminance of the whole image.&lt;br /&gt;
** Rather than playing empirically with the 3 parameters Black Ev, White Ev, ‘Mean luminance (Yb%) Scene’ , this led me to base the action on the distribution of blacks and whites, this action having an effect on the value of ‘Mean Luminance (Yb%) Scene’. By default, ‘White distribution’ is set to 20 to take account of Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====How do we use the three values of  Black Ev, White Ev and ‘Mean luminance (Yb %) Scene’.? ====&lt;br /&gt;
* Log Encoding calculates a logarithmic base from the Black Ev scene value, the dynamic range and the ‘Mean Luminance (Yb%)’ viewing value. This logarithmic conversion is applied to all the data to be processed. It seems clear that the processing here is anything but linear. Depending on the image, the result will sometimes be an excess of shadow enhancement and highlight attenuation compared to the average highlights. In addition, this conversion can profoundly modify the colorimetry. For Log Encoding, the algorithm in Rawtherapee only allows simple colour corrections (saturation, brightness compression). The advantage of this algorithm is that it can handle a very high dynamic range.&lt;br /&gt;
* Sigmoid, as its name suggests, uses a mathematical sigmoid based on 3 main concepts: a) an asymptotic attenuation (especially for whites) giving highlights a more natural appearance; b) a variable slope of the sigmoid acurve cting on overall contrast; c) a shift (skew) of the sigmoid so that the action is primarily on highlights or shadows (you can't have both). The advantage of this algorithm is its apparent simplicity, and it works very well on images that are not too difficult. &lt;br /&gt;
** Simulation: I'm attaching a demonstration of a Sigmoid curve with 2 parameters where ‘L’ corresponds to ‘Contrast’ and ‘t’ corresponds to ‘Skew’. Note that the calculation performed in the code is slightly different. This simulation is for demonstration purposes only.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* The Gamma-based and Slope-based functions both use Freeman's tone-mapping algorithm. Gamma-based only uses the asymptotic function to give highlights a more natural appearance. Slope-based adds the low and mid tones. Its principle is somewhat different from that of Sigmoid and is similar to that of a TRC (the processing of the shadows not being strictly linear). The advantage of this algorithm is its simplicity; it enables effective treatment of the attenuation of highlights and also allows you to act on the overall contrast.&lt;br /&gt;
** You also have the choice of ‘RGB channel Slope’, which is partly similar to RGB Curves, allowing differentiated action on the three R, G and B channels. Compared with Slope-based, a number of settings have been added to make full use of Freeman's algorithm: &lt;br /&gt;
*** Dynamic range (DR) is taken into account for the Viewing value of Yb % in addition to the Scene value,&lt;br /&gt;
*** Luminosity mode to try and preserve luminance (similar to RGB curves) - this mode can lead to strong artefacts,&lt;br /&gt;
*** Attenuation threshold associated with the ‘Highlight attenuation only’ choice to modulate the start of the action on highlights (normally from the Yb % Scene value).    &lt;br /&gt;
&lt;br /&gt;
In all 3 cases (Log Encoding, Sigmoid and the Freeman algorithm) we use the Scene (source) data to make it fit into a useful range that is consistent with our own visual capabilities and those of the peripheral (screens, etc.).&lt;br /&gt;
This useful range is also a source of debate: a) should we use relative luminance for the output peripherals or absolute luminance with the notions of Peak and ‘Diffuse white’ for luminance; b) our eye-brain pairing has much better performance than any peripheral and takes into account other physiological parameters (Ciecam).&lt;br /&gt;
The Cam16 (Selective Editing) module tries to take all these parameters into account (as much as possible).&lt;br /&gt;
&lt;br /&gt;
* The case of Sigmoid Q and Slope based Q: I wanted to integrate the 2 Sigmoid and Slope based algorithms into Cam16's Q (Absolute luminance) loop (which has 6 variables). It's clear that we are no longer upstream of the process, but in the process. In particular, the Scene value of Yb% (middle grey) is profoundly modified by Ciecam. I've therefore applied an average empirical correction coefficient. These 2 algorithms should be seen more as personal challenges than as real alternatives.&lt;br /&gt;
====How do I use these tone-mapping algorithms? ====&lt;br /&gt;
* These tone-mapping algorithms can be described as semi-automatic, because the parameters used – Black Ev, White Ev and the Scene value of ‘Mean Luminance (Yb%)’ - are automatically pre-calculated. The values to be adjusted for Sigmoid or Slope-based are close to the default values.&lt;br /&gt;
* Log encoding can be used as a first step, and the TRC (using Gamma, Slope and Midtones) or even Sigmoid can be used as a complement.&lt;br /&gt;
* For the other cases (the majority), I recommend starting the process with TRC (gamma, slope, midtones) and attenuating the highlights either with ‘Ev- based’ or ‘Gamma-based’. If you want to increase the overall contrast you can activate ‘Slope-based’ or Sigmoid.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Local Contrast===&lt;br /&gt;
As I said earlier, I think it's better to use a moderate amount of overall contrast to highlight the main subject (flowers, buildings, animals, etc.) and then add some local contrast. This can take 2 forms:&lt;br /&gt;
* Either by using a guided-filter type algorithm (incorporated into Cam16) for small adjustments,&lt;br /&gt;
* Or by using variable local contrast  using wavelets. &lt;br /&gt;
** In the Abstract Profile module you have Contrast Enhancement based on the notion of contrast profiles.&lt;br /&gt;
 [File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* In Selective Editing, there is the Local Contrast &amp;amp; Wavelets tool, which in Basic mode allows you to adjust the local contrast (by choosing the appropriate range of decomposition levels) along with a Clarity function.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10815</id>
		<title>Toolchain Pipeline</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10815"/>
		<updated>2024-08-27T10:50:09Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Importance of the Linear-RGB Model and Colorimetry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Toolchain Pipeline and Colorimetry&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Toolchain Pipeline ==&lt;br /&gt;
&lt;br /&gt;
=== Processing Order ===&lt;br /&gt;
&lt;br /&gt;
Everything that happens to an image, from the moment you open the file to the moment it is displayed on screen or saved, takes place in a fixed order. The data flows from one module to another - this is the toolchain pipeline. RawTherapee contains four pipelines (one for the main preview, one for the saved image, one for the thumbnail, and one other that currently escaped me). The following list shows a simplified order of operations:&lt;br /&gt;
&lt;br /&gt;
# Preprocess&lt;br /&gt;
## Dark frame&lt;br /&gt;
## Flat field&lt;br /&gt;
## Bad pixels&lt;br /&gt;
## Hot pixels&lt;br /&gt;
## Scale colors (internal, no tool in UI)&lt;br /&gt;
## Raw black point&lt;br /&gt;
## Lens distortion correction&lt;br /&gt;
## Green equilibration&lt;br /&gt;
## Line noise filter&lt;br /&gt;
## Chromatic aberration Correction&lt;br /&gt;
## Raw white point&lt;br /&gt;
## Raw histogram&lt;br /&gt;
## Prepare Auto Exposure&lt;br /&gt;
# Demosaic&lt;br /&gt;
# Retinex&lt;br /&gt;
# Highlight recovery&lt;br /&gt;
# White balance&lt;br /&gt;
# Spot Removal&lt;br /&gt;
# Crop&lt;br /&gt;
# Convert colorspace&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Dehaze&lt;br /&gt;
# Dynamic range compression&lt;br /&gt;
# (Local Adjustments branch) avoid color shift, Log encoding, blur-noise denoise, tone-mapping, dehaze &amp;amp; retinex, contrast by detail levels, vibrance, soflight, local contrast, wavelet, sharp, exposure, color and light, Color appearance (Cam16 &amp;amp; JzCzhz), avoid color shift&lt;br /&gt;
# Auto-match tone curve&lt;br /&gt;
# Tone response curve&lt;br /&gt;
# Process RGB&lt;br /&gt;
## Channel mixer&lt;br /&gt;
## Tone curve&lt;br /&gt;
## Highlights&lt;br /&gt;
## Shadows&lt;br /&gt;
## RGB curves&lt;br /&gt;
## HSV curves&lt;br /&gt;
## Color toning&lt;br /&gt;
## Film simulation&lt;br /&gt;
## Black-and-white&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
# Process Lab&lt;br /&gt;
## Shadows/Highlight (Lab)&lt;br /&gt;
## Local contrast (Lab)&lt;br /&gt;
## Lab adjustements&lt;br /&gt;
## Vibrance&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
## Vignette filter&lt;br /&gt;
## Graduated filter&lt;br /&gt;
## Tone mapping&lt;br /&gt;
## Impulse noise reduction&lt;br /&gt;
## Defringe&lt;br /&gt;
## Edges&lt;br /&gt;
## Microcontrast&lt;br /&gt;
## Sharpening&lt;br /&gt;
## Contrast by Detail Levels&lt;br /&gt;
## Wavelets&lt;br /&gt;
## Soft light&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Resize&lt;br /&gt;
## Post-resize sharpening&lt;br /&gt;
# Final Lab -&amp;gt; RGB conversion&lt;br /&gt;
&lt;br /&gt;
=== List of All Tools in RawTherapee ===&lt;br /&gt;
&lt;br /&gt;
* Generic/Main preview&lt;br /&gt;
** Input profile&lt;br /&gt;
** Monitor Color Profile&lt;br /&gt;
** Working profile&lt;br /&gt;
** Output profile&lt;br /&gt;
** Clipping indication&lt;br /&gt;
** Red/Green/Blue/Luminosity/Focus mask previews&lt;br /&gt;
** Colorimetric intent&lt;br /&gt;
* Exposure Tab&lt;br /&gt;
** Exposure&lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Mapping&lt;br /&gt;
** Dynamic Range Compression&lt;br /&gt;
** Vignette Filter&lt;br /&gt;
** Graduated Filter&lt;br /&gt;
** Lab Adjustments&lt;br /&gt;
* Detail Tab&lt;br /&gt;
** Sharpening&lt;br /&gt;
** Local Contrast&lt;br /&gt;
** Edges&lt;br /&gt;
** Microcontrast&lt;br /&gt;
** Impulse Noise Reduction&lt;br /&gt;
** Noise Reduction&lt;br /&gt;
** Defringe&lt;br /&gt;
** Contrast by Detail Levels&lt;br /&gt;
** Haze Removal&lt;br /&gt;
* Color Tab&lt;br /&gt;
** White Balance&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Channel Mixer&lt;br /&gt;
** Black-and-White&lt;br /&gt;
** HSV Equalizer&lt;br /&gt;
** Film Simulation&lt;br /&gt;
** Soft Light&lt;br /&gt;
** RGB Curves&lt;br /&gt;
** Color Toning&lt;br /&gt;
** Color Management&lt;br /&gt;
* Advanced Tab&lt;br /&gt;
** Retinex&lt;br /&gt;
** CIE Color Appearance Model 2002&lt;br /&gt;
** Wavelet Levels&lt;br /&gt;
* Transform Tab&lt;br /&gt;
** Crop&lt;br /&gt;
** Resize&lt;br /&gt;
** Lens/Geometry&lt;br /&gt;
*** Rotate&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profiled Lens Correction&lt;br /&gt;
*** Distortion Correction&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
*** Vignetting Correction&lt;br /&gt;
* Raw Tab&lt;br /&gt;
** Sensor with Bayer matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
*** Preprocessing&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
** Sensor with X-Trans matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
** Raw White Points&lt;br /&gt;
** Preprocessing&lt;br /&gt;
** Dark Frame&lt;br /&gt;
** Flat-Field&lt;br /&gt;
** Film Negative&lt;br /&gt;
** Capture Sharpening&lt;br /&gt;
&lt;br /&gt;
== Colorimetry ==&lt;br /&gt;
&lt;br /&gt;
=== The Importance of CIECAM and L*a*b* ===&lt;br /&gt;
&lt;br /&gt;
Colorimetry gives rise to a lot of debate but we have to remember that it is not an exact science. No amount of equations, however complex, can ensure that the human eye will necessarily be satisfied with an image. &lt;br /&gt;
&lt;br /&gt;
Currently RawTherapee uses the L*a*b* color space and CIECAM02/16 for chromatic adaptation and work has begun on exploring other color spaces (Jzazbz) and CAM models, for HDR applications (ZCAM does not work)..&lt;br /&gt;
 &lt;br /&gt;
The use of the L*a*b* (or CIELAB) color space does have its limitations but many of its shortcomings can be successfully mitigated, at least for SDR applications.&lt;br /&gt;
 &lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* One of the most frequent criticisms is that L*a*b* is non-linear and that it &amp;quot;distorts&amp;quot; the colors, in particular for blue-violet and red-orange. This is certainly true if you simply adjust the image using curves or chromaticity sliders. However in RawTherapee, if you click on &amp;quot;Avoid color shift&amp;quot; (Munsell correction), nearly 200 LUTs will correct these shifts and make the image perfectly linear. &lt;br /&gt;
* It is also said that L*a*b* addresses imaginary colors if the working profile allows it. This is also true but again, this can be compensated in RawTherapee by enabling &amp;quot;Avoid color shift&amp;quot;. In this case, a relative colorimetric correction is applied to the working gamut as follows:  &lt;br /&gt;
** It analyzes the image data.&lt;br /&gt;
** If it is within gamut no action is taken.&lt;br /&gt;
** If it is outside gamut,the chroma is reduced and if this is insufficient, or if it is close to L=0 or L=100, then L is adjusted.&lt;br /&gt;
** You can also choose the algorithm developed by Emil Martinec (gamutmap) which provides XYZ control (absolute or relative).&lt;br /&gt;
** However this should rarely occur if Prophoto is used in the Working Profile and is probably not important.&lt;br /&gt;
** If the saturation has been adjusted (chroma, vibrance,…), a Munsell correction using nearly 200 LUTs is applied. This will correct any color shifts with a high degree of accuracy e.g a red that has turned orange because of L*a*b*, will become red again. There will still be some errors but they are very small.&lt;br /&gt;
** The Munsell correction is applied in all cases unless none is selected.&lt;br /&gt;
&lt;br /&gt;
==== L*a*b* ====&lt;br /&gt;
&lt;br /&gt;
*  L*a*b* is a reversible transformation of XYZ (in simplified terms, Y is transformed into L* using a gamma of 3.0 and a slope of 9.03). L*a*b* has more or less the same characteristics in terms of its limits (those of the primaries) as XYZ, which serves as a reference for the Working Profile and determines the basis of the gamut. Therefore L*a*b* and XYZ have essentially the same characteristics (exposure range, gamut, etc.). One point however, in many processes the values of L* can be bounded (clipped), to limit artifacts (high contrasts, highlights...), but in most cases L* is unbounded. If we ever get to HDR processing, we'll probably have to switch to &amp;quot;HDR-Lab&amp;quot;. The data is not lost, even for high-dynamic range images (&amp;gt;= 25Ev), but the progression in the highlights is not progressive enough when used with monitors capable of displaying luminance values in the range of 120 cd/m² and beyond.&lt;br /&gt;
* I don’t think that the RGB-&amp;gt;Lab transformation itself prevents complete HDR processing. This is because the calculations are generally carried out using ‘float’ or ‘double’ data values (32 or 64 bits) or using SSE (128 bit - 4x32 or 2x64 bits). The linear part of the Lab transform allows shadows with values of 0.005 cd/m2 or less to be processed. The parabolic part (gamma = 3.0) limits the distribution of data in the highlights allowing them to be reproduced more accurately (on suitable monitors) with luminance values above 120 cd/m2. The XYZ&amp;lt;=&amp;gt;Lab conversion leads to hardly any loss of data (insignificant due to double conversions) and can be considered as a kind of lossless compression. Of course if we want to achieve complete HDR processing, it is necessary to ensure that the way the data is processed, prior to being sent to the monitor, allows for more progression in the highlights. The preferred approach for Rawtherapee would be to implement HDR-Lab instead of Lab. But in the meantime I have implemented the possibility of changing the gamma of Lab (3.0) for several tools (wavelets, tone-mapping, etc.) notably to make it linear. It should be noted that Rawtherapee is designed to overcome one of the problems with Lab, which is the non-preservation of the hue when the saturation changes (especially in oranges and purples), by using &amp;quot;Perceptual Uniform Lab&amp;quot;. This involves using a series of Munsell LUTs, as well as gamut control to prevent virtual colors.&lt;br /&gt;
&lt;br /&gt;
====L*a*b* does not impact the gamut or the dynamic range of high-dynamic-range images as shown in the following example with a Dynamic Range of 25Ev====&lt;br /&gt;
Note that the majority of digital cameras in 2024 have a maximum dynamic range of about 15Ev. This image is therefore exceptional but demonstrates the behavior of Lab* for images with a high dynamic range.&lt;br /&gt;
&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of L*a*b* does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
==== CIECAM02/16 ====&lt;br /&gt;
&lt;br /&gt;
* One criticism of Ciecam02 is that is not able to process high dynamic range and wide color gamut images, which is partially true. A number of improvements were made by the development team a few years ago to mitigate this problem (bearing in mind that a large number of user images fall within the sRGB gamut and do not pose a problem). However, by using Log Encoding in conjunction with Cam16, or Color appearance (Cam16 &amp;amp; JzCzHz), the vast majority of problems can be solved. Of course some images will still present problems, in particular with highlight reconstruction, but this is not specific to Ciecam. The addition of Ciecam16 (Cam16) solves some of these problems.&lt;br /&gt;
* Ciecam02/16 is one of the only ways to achieve true colorimetric correction because it takes into account human perception and the surrounding environment. With Ciecam for example, any adjustments to the luminosity and/or the saturation, will take into account the image and its environment.&lt;br /&gt;
&lt;br /&gt;
==== White Balance ====&lt;br /&gt;
&lt;br /&gt;
* White balance is also subject to debate. The Temperature Correlation module recently introduced in Rawtherapee is almost mathematically (cognitively) perfect. It makes the xyY colors of the image coincide with known spectral data. However, on images where the temperature deviates a long way from D50, the colorimetry will not be correct because there will not be the necessary chromatic adaptation expected by our eyes and brain. Ciecam however, can take this into account.&lt;br /&gt;
&lt;br /&gt;
=== Importance of the Linear-RGB Model and Colorimetry ===&lt;br /&gt;
&lt;br /&gt;
The merits of the RGB model, and in particular, the linear RGB model are frequently cited. It is certainly the best way to carry out “upstream” processing (demosaicing, white balance, defringing, chromatic aberration correction, etc.) and anything that can be done in this mode should be.&lt;br /&gt;
&lt;br /&gt;
However, CIELAB and Ciecam02/16 still have their place despite their shortcomings. As we have seen above, they are both derived from the CIE XYZ tristimulus values with Ciecam being one of the only ways to achieve true colorimetric correction.&lt;br /&gt;
&lt;br /&gt;
So what about tone curves?&lt;br /&gt;
&lt;br /&gt;
* Not only are they non-linear but they only provide limited colorimetric compensation, if any (with the exception of the Perceptual mode, which uses Ciecam02). This is in contrast to the Tone Response Curves -TRC- used for output (monitor, TIF etc.).&lt;br /&gt;
* The Auto-Matched Tone Curve, which is a copy of the in-camera TRC, is applied mid-process and introduces non-linearities in the processing pipeline.&lt;br /&gt;
&lt;br /&gt;
What about saturation?&lt;br /&gt;
&lt;br /&gt;
* Maintaining RGB linearity when you change the saturation is not impossible but it is difficult and is not implemented in Rawtherapee. On the other hand, if you adjust the saturation using Ciecam, it will take into account variations in luminance (or brightness) and adapt the color accordingly.&lt;br /&gt;
&lt;br /&gt;
In conclusion, RGB, L *a *b *, and Ciecam all have their advantages and disadvantages. They simply need to be understood so that they can be used appropriately.&lt;br /&gt;
&lt;br /&gt;
===What are the acceptable principles for processing SDR or HDR images?===&lt;br /&gt;
The argument below is partly based on the fact that Rawtherapee has two Ciecam modules, one located at the end of the main process (Color Appearance &amp;amp; Lighting), the other in Selective Editing, Color Appearance (Cam16) located just after white balance. These 2 modules are Color Appearance Models (CAMs) and contain all the processes and tools needed to ensure good colorimetry. However, these 2 modules alone are not always able to process:&lt;br /&gt;
a) images with a very high dynamic range, &lt;br /&gt;
b) images with very pronounced shadows, &lt;br /&gt;
c) images with strong highlights (not to be confused with highlight reconstruction).&lt;br /&gt;
&lt;br /&gt;
The science of colour matching is often inexact and imprecise. Nevertheless, as we have seen, the most linear treatment possible seems to be recommended if practicable. However, this seems impossible if the differences linked to a) b) c) above are significant. &lt;br /&gt;
In these cases, I propose as a first step a principle close to that of the rendering of human vision: a linear part (slope) to ‘unblock’ the shadows and a parabolic part (gamma) to render the perception of medium tones and highlights fairly similar to that of our eye/brain pair. This linear/parabolic differentiation is commonly used in various software applications e.g., sRGB gamma where Slope =12.92 and Gamma=2.4, or BT709 where slope=4.5 and Gamma=2.22 or ‘Lab’ where Slope=9.03 and Gamma=3.0.&lt;br /&gt;
The two Tone Response Curve (TRC) modules present in the Abstract Profile module or in Selective Editing &amp;gt; Color Appearance &amp;gt; Source Data Adjustments provide a partial response to the problems described in a) and b), by allowing adjustments to be carried out with higher Slope and Gamma values.&lt;br /&gt;
&lt;br /&gt;
The problem of reducing highlights, improving overall contrast and using local contrast still remains and will be discussed below.&lt;br /&gt;
&lt;br /&gt;
Don't forget that Cam16 is a processing module in its own right. You can use it to process images using tools such as:&lt;br /&gt;
* Surround or Scene conditions ( average, dim, dark etc.) which allows you to take dark or very dark backgrounds into account. This algorithm alone can provide shadow enhancement in certain images.&lt;br /&gt;
*Lightness, Brightness (and their corresponding contrast parameters), Chroma, Saturation, Colorfulness, etc.&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above, colorimetry is not an exact science so you should use whichever tools give a result that is pleasing to your eye. &lt;br /&gt;
&lt;br /&gt;
===How useful are ICC and DCP input profiles ? ===&lt;br /&gt;
Raw files are generally decoded using a matrix (from Adobe) called ‘Color Matrix1’ based on the D65 illuminant. This matrix is sufficient in the vast majority of cases.&lt;br /&gt;
It can be replaced by either an ICC profile or a DCP profile that has been developed either by the user, using a Colorchecker24 for example, or supplied by Rawtherapee or Adobe.&lt;br /&gt;
There are two broad problems with these sorts of profiles:&lt;br /&gt;
* The Colorchecker24 is limited (with one exception in blues) to the sRGB gamut. What happens when such a profile is used, for example, on images of flowers or minerals where the gamut is much larger?&lt;br /&gt;
* The profile is only really relevant for a given illuminant. What happens when a profile developed for D50 (daylight in the sun) is used in the shade? It is true that DCP profiles have an interpolation table between D65 and Tungsten 2850K, but this is still approximate.&lt;br /&gt;
My point is not to say that you shouldn’t use these profiles, which are very useful for reproducing paintings, coins, etc. in controlled lighting, but to show their limitations.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Auto-Matched Tone Curve?&lt;br /&gt;
The answer is: maybe? &lt;br /&gt;
This curve generated from the JPEG attached to the Raw reproduces the colourimetry of the camera manufacturer (Canon, Nikon, Sony, etc.). This is a criterion of choice, but it has a few constraints:&lt;br /&gt;
* The generated curve can lead to an increase in contrast which, depending on the image, may cause clipping in the shadows and highlights. In many cases, this increase in contrast is undesirable.&lt;br /&gt;
* The default choice of ‘Film-like’ modifies the colorimetry. This modification contradicts the underlying philosophy of Ciecam. If you want to keep the Auto-Matched Tone Curve, it is better to use the Standard mode.&lt;br /&gt;
&lt;br /&gt;
===Should I use the Exposure module, and in particular ‘Exposure compensation’?===&lt;br /&gt;
The answer is: with reservations.&lt;br /&gt;
In the case of images of type a), b) or c), the Exposure slider will bring about a linear change in exposure (in Ev), increasing (or reducing) shadows and highlights in the same way. The ‘Highlight compression’ and Blacks sliders can be used to mitigate this but the adjustment is not very intuitive and can conflict with the TRC Gamma/Slope adjustments. An alternative is to use the Tone Equalizer (in the main menu or in Selective Editing), which allows progressive differentiation of highlights and shadows.&lt;br /&gt;
&lt;br /&gt;
===Tone-mapping modules - description and use===&lt;br /&gt;
I'll only focus on the modules using Black Ev, White Ev and ‘Mean Luminance (Yb%) Scene’. For the other Rawtherapee tone mapping modules are concerned:&lt;br /&gt;
* Tone Mapping is more a module for significantly modifying the local contrast (texture) than for carrying out a true tone mapping.&lt;br /&gt;
* Dynamic Range Compression uses a Laplacian and a Fourier transform. Its performance is OK, but it is slow and consumes a lot of resources.&lt;br /&gt;
* Note that most images - even with modern cameras - are limited to 14 or 15 Ev. HDR software that produces a DNG image from several bracketed images should be able to reach around 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)| Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
In english&lt;br /&gt;
[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_Selective_Editing | An evaluation of the dynamic-range capabilities of tools in Selective_Editing]]&lt;br /&gt;
&lt;br /&gt;
====The principle of calculating Dynamic Range (DR)====&lt;br /&gt;
Three algorithms use the concepts associated with Dynamic Range i.e. Black Ev, White Ev and ‘Mean Luminance (Yb) scene’ (a concept close to that of middle grey).&lt;br /&gt;
* Log Encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma-based and Slope-based highlight roll-off (my favourite).&lt;br /&gt;
&lt;br /&gt;
How are these values assessed? It's a difficult exercise, because it involves finding the blackest point (black point), the whitest point (white point) and the average grey value (Yb%) on an unprocessed image. We use a fairly empirical and approximate formula evaluates these 3 data points, which are then used by the 3 algorithms mentioned.&lt;br /&gt;
* The first question is: ‘What data are we using and at what stage in the processing pipeline? Rawtherapee uses the data just after white balance and after conversion to the Working Profile (except for Sigmoid Q and Slope-based Q which are incorporated into the Cam16 process).&lt;br /&gt;
* The second question is: ‘Are these values representative of reality? It’s not sure because in particular:&lt;br /&gt;
** We don't know how the blacks near the black point and whites near the white point are mapped,&lt;br /&gt;
** The value of middle grey is, on the one hand, marred by approximations and on the other, Ciecam takes into account the luminance of the background Yb%, and not the luminance of the whole image.&lt;br /&gt;
** Rather than playing empirically with the 3 parameters Black Ev, White Ev, ‘Mean luminance (Yb%) Scene’ , this led me to base the action on the distribution of blacks and whites, this action having an effect on the value of ‘Mean Luminance (Yb%) Scene’. By default, ‘White distribution’ is set to 20 to take account of Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====How do we use the three values of  Black Ev, White Ev and ‘Mean luminance (Yb %) Scene’.? ====&lt;br /&gt;
* Log Encoding calculates a logarithmic base from the Black Ev scene value, the dynamic range and the ‘Mean Luminance (Yb%)’ viewing value. This logarithmic conversion is applied to all the data to be processed. It seems clear that the processing here is anything but linear. Depending on the image, the result will sometimes be an excess of shadow enhancement and highlight attenuation compared to the average highlights. In addition, this conversion can profoundly modify the colorimetry. For Log Encoding, the algorithm in Rawtherapee only allows simple colour corrections (saturation, brightness compression). The advantage of this algorithm is that it can handle a very high dynamic range.&lt;br /&gt;
* Sigmoid, as its name suggests, uses a mathematical sigmoid based on 3 main concepts: a) an asymptotic attenuation (especially for whites) giving highlights a more natural appearance; b) a variable slope of the sigmoid acurve cting on overall contrast; c) a shift (skew) of the sigmoid so that the action is primarily on highlights or shadows (you can't have both). The advantage of this algorithm is its apparent simplicity, and it works very well on images that are not too difficult. &lt;br /&gt;
** Simulation: I'm attaching a demonstration of a Sigmoid curve with 2 parameters where ‘L’ corresponds to ‘Contrast’ and ‘t’ corresponds to ‘Skew’. Note that the calculation performed in the code is slightly different. This simulation is for demonstration purposes only.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* The Gamma-based and Slope-based functions both use Freeman's tone-mapping algorithm. Gamma-based only uses the asymptotic function to give highlights a more natural appearance. Slope-based adds the low and mid tones. Its principle is somewhat different from that of Sigmoid and is similar to that of a TRC (the processing of the shadows not being strictly linear). The advantage of this algorithm is its simplicity; it enables effective treatment of the attenuation of highlights and also allows you to act on the overall contrast.&lt;br /&gt;
** You also have the choice of ‘RGB channel Slope’, which is partly similar to RGB Curves, allowing differentiated action on the three R, G and B channels. Compared with Slope-based, a number of settings have been added to make full use of Freeman's algorithm: &lt;br /&gt;
*** Dynamic range (DR) is taken into account for the Viewing value of Yb % in addition to the Scene value,&lt;br /&gt;
*** Luminosity mode to try and preserve luminance (similar to RGB curves) - this mode can lead to strong artefacts,&lt;br /&gt;
*** Attenuation threshold associated with the ‘Highlight attenuation only’ choice to modulate the start of the action on highlights (normally from the Yb % Scene value).    &lt;br /&gt;
&lt;br /&gt;
In all 3 cases (Log Encoding, Sigmoid and the Freeman algorithm) we use the Scene (source) data to make it fit into a useful range that is consistent with our own visual capabilities and those of the peripheral (screens, etc.).&lt;br /&gt;
This useful range is also a source of debate: a) should we use relative luminance for the output peripherals or absolute luminance with the notions of Peak and ‘Diffuse white’ for luminance; b) our eye-brain pairing has much better performance than any peripheral and takes into account other physiological parameters (Ciecam).&lt;br /&gt;
The Cam16 (Selective Editing) module tries to take all these parameters into account (as much as possible).&lt;br /&gt;
&lt;br /&gt;
* The case of Sigmoid Q and Slope based Q: I wanted to integrate the 2 Sigmoid and Slope based algorithms into Cam16's Q (Absolute luminance) loop (which has 6 variables). It's clear that we are no longer upstream of the process, but in the process. In particular, the Scene value of Yb% (middle grey) is profoundly modified by Ciecam. I've therefore applied an average empirical correction coefficient. These 2 algorithms should be seen more as personal challenges than as real alternatives.&lt;br /&gt;
====How do I use these tone-mapping algorithms? ====&lt;br /&gt;
* These tone-mapping algorithms can be described as semi-automatic, because the parameters used – Black Ev, White Ev and the Scene value of ‘Mean Luminance (Yb%)’ - are automatically pre-calculated. The values to be adjusted for Sigmoid or Slope-based are close to the default values.&lt;br /&gt;
* Log encoding can be used as a first step, and the TRC (using Gamma, Slope and Midtones) or even Sigmoid can be used as a complement.&lt;br /&gt;
* For the other cases (the majority), I recommend starting the process with TRC (gamma, slope, midtones) and attenuating the highlights either with ‘Ev- based’ or ‘Gamma-based’. If you want to increase the overall contrast you can activate ‘Slope-based’ or Sigmoid.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Local Contrast===&lt;br /&gt;
As I said earlier, I think it's better to use a moderate amount of overall contrast to highlight the main subject (flowers, buildings, animals, etc.) and then add some local contrast. This can take 2 forms:&lt;br /&gt;
* Either by using a guided-filter type algorithm (incorporated into Cam16) for small adjustments,&lt;br /&gt;
* Or by using variable local contrast  using wavelets. &lt;br /&gt;
** In the Abstract Profile module you have Contrast Enhancement based on the notion of contrast profiles.&lt;br /&gt;
 [File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* In Selective Editing, there is the Local Contrast &amp;amp; Wavelets tool, which in Basic mode allows you to adjust the local contrast (by choosing the appropriate range of decomposition levels) along with a Clarity function.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10814</id>
		<title>Toolchain Pipeline</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline&amp;diff=10814"/>
		<updated>2024-08-22T08:18:48Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* The Importance of CIECAM and L*a*b* */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Toolchain Pipeline and Colorimetry&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Toolchain Pipeline ==&lt;br /&gt;
&lt;br /&gt;
=== Processing Order ===&lt;br /&gt;
&lt;br /&gt;
Everything that happens to an image, from the moment you open the file to the moment it is displayed on screen or saved, takes place in a fixed order. The data flows from one module to another - this is the toolchain pipeline. RawTherapee contains four pipelines (one for the main preview, one for the saved image, one for the thumbnail, and one other that currently escaped me). The following list shows a simplified order of operations:&lt;br /&gt;
&lt;br /&gt;
# Preprocess&lt;br /&gt;
## Dark frame&lt;br /&gt;
## Flat field&lt;br /&gt;
## Bad pixels&lt;br /&gt;
## Hot pixels&lt;br /&gt;
## Scale colors (internal, no tool in UI)&lt;br /&gt;
## Raw black point&lt;br /&gt;
## Lens distortion correction&lt;br /&gt;
## Green equilibration&lt;br /&gt;
## Line noise filter&lt;br /&gt;
## Chromatic aberration Correction&lt;br /&gt;
## Raw white point&lt;br /&gt;
## Raw histogram&lt;br /&gt;
## Prepare Auto Exposure&lt;br /&gt;
# Demosaic&lt;br /&gt;
# Retinex&lt;br /&gt;
# Highlight recovery&lt;br /&gt;
# White balance&lt;br /&gt;
# Spot Removal&lt;br /&gt;
# Crop&lt;br /&gt;
# Convert colorspace&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Dehaze&lt;br /&gt;
# Dynamic range compression&lt;br /&gt;
# (Local Adjustments branch) avoid color shift, Log encoding, blur-noise denoise, tone-mapping, dehaze &amp;amp; retinex, contrast by detail levels, vibrance, soflight, local contrast, wavelet, sharp, exposure, color and light, Color appearance (Cam16 &amp;amp; JzCzhz), avoid color shift&lt;br /&gt;
# Auto-match tone curve&lt;br /&gt;
# Tone response curve&lt;br /&gt;
# Process RGB&lt;br /&gt;
## Channel mixer&lt;br /&gt;
## Tone curve&lt;br /&gt;
## Highlights&lt;br /&gt;
## Shadows&lt;br /&gt;
## RGB curves&lt;br /&gt;
## HSV curves&lt;br /&gt;
## Color toning&lt;br /&gt;
## Film simulation&lt;br /&gt;
## Black-and-white&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
# Process Lab&lt;br /&gt;
## Shadows/Highlight (Lab)&lt;br /&gt;
## Local contrast (Lab)&lt;br /&gt;
## Lab adjustements&lt;br /&gt;
## Vibrance&lt;br /&gt;
## L*a*b* color correction grid (Lab)&lt;br /&gt;
## Vignette filter&lt;br /&gt;
## Graduated filter&lt;br /&gt;
## Tone mapping&lt;br /&gt;
## Impulse noise reduction&lt;br /&gt;
## Defringe&lt;br /&gt;
## Edges&lt;br /&gt;
## Microcontrast&lt;br /&gt;
## Sharpening&lt;br /&gt;
## Contrast by Detail Levels&lt;br /&gt;
## Wavelets&lt;br /&gt;
## Soft light&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Resize&lt;br /&gt;
## Post-resize sharpening&lt;br /&gt;
# Final Lab -&amp;gt; RGB conversion&lt;br /&gt;
&lt;br /&gt;
=== List of All Tools in RawTherapee ===&lt;br /&gt;
&lt;br /&gt;
* Generic/Main preview&lt;br /&gt;
** Input profile&lt;br /&gt;
** Monitor Color Profile&lt;br /&gt;
** Working profile&lt;br /&gt;
** Output profile&lt;br /&gt;
** Clipping indication&lt;br /&gt;
** Red/Green/Blue/Luminosity/Focus mask previews&lt;br /&gt;
** Colorimetric intent&lt;br /&gt;
* Exposure Tab&lt;br /&gt;
** Exposure&lt;br /&gt;
** Shadows/Highlights&lt;br /&gt;
** Tone Mapping&lt;br /&gt;
** Dynamic Range Compression&lt;br /&gt;
** Vignette Filter&lt;br /&gt;
** Graduated Filter&lt;br /&gt;
** Lab Adjustments&lt;br /&gt;
* Detail Tab&lt;br /&gt;
** Sharpening&lt;br /&gt;
** Local Contrast&lt;br /&gt;
** Edges&lt;br /&gt;
** Microcontrast&lt;br /&gt;
** Impulse Noise Reduction&lt;br /&gt;
** Noise Reduction&lt;br /&gt;
** Defringe&lt;br /&gt;
** Contrast by Detail Levels&lt;br /&gt;
** Haze Removal&lt;br /&gt;
* Color Tab&lt;br /&gt;
** White Balance&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Channel Mixer&lt;br /&gt;
** Black-and-White&lt;br /&gt;
** HSV Equalizer&lt;br /&gt;
** Film Simulation&lt;br /&gt;
** Soft Light&lt;br /&gt;
** RGB Curves&lt;br /&gt;
** Color Toning&lt;br /&gt;
** Color Management&lt;br /&gt;
* Advanced Tab&lt;br /&gt;
** Retinex&lt;br /&gt;
** CIE Color Appearance Model 2002&lt;br /&gt;
** Wavelet Levels&lt;br /&gt;
* Transform Tab&lt;br /&gt;
** Crop&lt;br /&gt;
** Resize&lt;br /&gt;
** Lens/Geometry&lt;br /&gt;
*** Rotate&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profiled Lens Correction&lt;br /&gt;
*** Distortion Correction&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
*** Vignetting Correction&lt;br /&gt;
* Raw Tab&lt;br /&gt;
** Sensor with Bayer matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
*** Preprocessing&lt;br /&gt;
*** Chromatic Aberration Correction&lt;br /&gt;
** Sensor with X-Trans matrix&lt;br /&gt;
*** Demosaicing&lt;br /&gt;
*** Raw Black Points&lt;br /&gt;
** Raw White Points&lt;br /&gt;
** Preprocessing&lt;br /&gt;
** Dark Frame&lt;br /&gt;
** Flat-Field&lt;br /&gt;
** Film Negative&lt;br /&gt;
** Capture Sharpening&lt;br /&gt;
&lt;br /&gt;
== Colorimetry ==&lt;br /&gt;
&lt;br /&gt;
=== The Importance of CIECAM and L*a*b* ===&lt;br /&gt;
&lt;br /&gt;
Colorimetry gives rise to a lot of debate but we have to remember that it is not an exact science. No amount of equations, however complex, can ensure that the human eye will necessarily be satisfied with an image. &lt;br /&gt;
&lt;br /&gt;
Currently RawTherapee uses the L*a*b* color space and CIECAM02/16 for chromatic adaptation and work has begun on exploring other color spaces (Jzazbz) and CAM models, for HDR applications (ZCAM does not work)..&lt;br /&gt;
 &lt;br /&gt;
The use of the L*a*b* (or CIELAB) color space does have its limitations but many of its shortcomings can be successfully mitigated, at least for SDR applications.&lt;br /&gt;
 &lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
* One of the most frequent criticisms is that L*a*b* is non-linear and that it &amp;quot;distorts&amp;quot; the colors, in particular for blue-violet and red-orange. This is certainly true if you simply adjust the image using curves or chromaticity sliders. However in RawTherapee, if you click on &amp;quot;Avoid color shift&amp;quot; (Munsell correction), nearly 200 LUTs will correct these shifts and make the image perfectly linear. &lt;br /&gt;
* It is also said that L*a*b* addresses imaginary colors if the working profile allows it. This is also true but again, this can be compensated in RawTherapee by enabling &amp;quot;Avoid color shift&amp;quot;. In this case, a relative colorimetric correction is applied to the working gamut as follows:  &lt;br /&gt;
** It analyzes the image data.&lt;br /&gt;
** If it is within gamut no action is taken.&lt;br /&gt;
** If it is outside gamut,the chroma is reduced and if this is insufficient, or if it is close to L=0 or L=100, then L is adjusted.&lt;br /&gt;
** You can also choose the algorithm developed by Emil Martinec (gamutmap) which provides XYZ control (absolute or relative).&lt;br /&gt;
** However this should rarely occur if Prophoto is used in the Working Profile and is probably not important.&lt;br /&gt;
** If the saturation has been adjusted (chroma, vibrance,…), a Munsell correction using nearly 200 LUTs is applied. This will correct any color shifts with a high degree of accuracy e.g a red that has turned orange because of L*a*b*, will become red again. There will still be some errors but they are very small.&lt;br /&gt;
** The Munsell correction is applied in all cases unless none is selected.&lt;br /&gt;
&lt;br /&gt;
==== L*a*b* ====&lt;br /&gt;
&lt;br /&gt;
*  L*a*b* is a reversible transformation of XYZ (in simplified terms, Y is transformed into L* using a gamma of 3.0 and a slope of 9.03). L*a*b* has more or less the same characteristics in terms of its limits (those of the primaries) as XYZ, which serves as a reference for the Working Profile and determines the basis of the gamut. Therefore L*a*b* and XYZ have essentially the same characteristics (exposure range, gamut, etc.). One point however, in many processes the values of L* can be bounded (clipped), to limit artifacts (high contrasts, highlights...), but in most cases L* is unbounded. If we ever get to HDR processing, we'll probably have to switch to &amp;quot;HDR-Lab&amp;quot;. The data is not lost, even for high-dynamic range images (&amp;gt;= 25Ev), but the progression in the highlights is not progressive enough when used with monitors capable of displaying luminance values in the range of 120 cd/m² and beyond.&lt;br /&gt;
* I don’t think that the RGB-&amp;gt;Lab transformation itself prevents complete HDR processing. This is because the calculations are generally carried out using ‘float’ or ‘double’ data values (32 or 64 bits) or using SSE (128 bit - 4x32 or 2x64 bits). The linear part of the Lab transform allows shadows with values of 0.005 cd/m2 or less to be processed. The parabolic part (gamma = 3.0) limits the distribution of data in the highlights allowing them to be reproduced more accurately (on suitable monitors) with luminance values above 120 cd/m2. The XYZ&amp;lt;=&amp;gt;Lab conversion leads to hardly any loss of data (insignificant due to double conversions) and can be considered as a kind of lossless compression. Of course if we want to achieve complete HDR processing, it is necessary to ensure that the way the data is processed, prior to being sent to the monitor, allows for more progression in the highlights. The preferred approach for Rawtherapee would be to implement HDR-Lab instead of Lab. But in the meantime I have implemented the possibility of changing the gamma of Lab (3.0) for several tools (wavelets, tone-mapping, etc.) notably to make it linear. It should be noted that Rawtherapee is designed to overcome one of the problems with Lab, which is the non-preservation of the hue when the saturation changes (especially in oranges and purples), by using &amp;quot;Perceptual Uniform Lab&amp;quot;. This involves using a series of Munsell LUTs, as well as gamut control to prevent virtual colors.&lt;br /&gt;
&lt;br /&gt;
====L*a*b* does not impact the gamut or the dynamic range of high-dynamic-range images as shown in the following example with a Dynamic Range of 25Ev====&lt;br /&gt;
Note that the majority of digital cameras in 2024 have a maximum dynamic range of about 15Ev. This image is therefore exceptional but demonstrates the behavior of Lab* for images with a high dynamic range.&lt;br /&gt;
&lt;br /&gt;
TIF file  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
======Original image - 25Ev - unprocessed======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows lack detail.&lt;br /&gt;
* Approximately 40% of the image is 100% white.&lt;br /&gt;
* The restored black-to-white dynamic range is around 12 to 13 Ev.&lt;br /&gt;
&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Unprocessed]]&lt;br /&gt;
&lt;br /&gt;
======Image with Local Adjustments - Log Encoding======&lt;br /&gt;
Note:&lt;br /&gt;
* The shadows and highlights occupy the entire visible range from L=1 to L=99.8 (scale 0 – 100).&lt;br /&gt;
* The colors appear evenly distributed as a function of luminance. The use of L*a*b* does not impact the dynamic range. &lt;br /&gt;
* The dynamic range of the blacks, whites and color is restored to 25Ev.&lt;br /&gt;
* Note the use of &amp;quot;White distribution = 90&amp;quot;.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|With Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
==== CIECAM02/16 ====&lt;br /&gt;
&lt;br /&gt;
* One criticism of Ciecam02 is that is not able to process high dynamic range and wide color gamut images, which is partially true. A number of improvements were made by the development team a few years ago to mitigate this problem (bearing in mind that a large number of user images fall within the sRGB gamut and do not pose a problem). However, by using Log Encoding in conjunction with Cam16, or Color appearance (Cam16 &amp;amp; JzCzHz), the vast majority of problems can be solved. Of course some images will still present problems, in particular with highlight reconstruction, but this is not specific to Ciecam. The addition of Ciecam16 (Cam16) solves some of these problems.&lt;br /&gt;
* Ciecam02/16 is one of the only ways to achieve true colorimetric correction because it takes into account human perception and the surrounding environment. With Ciecam for example, any adjustments to the luminosity and/or the saturation, will take into account the image and its environment.&lt;br /&gt;
&lt;br /&gt;
==== White Balance ====&lt;br /&gt;
&lt;br /&gt;
* White balance is also subject to debate. The Temperature Correlation module recently introduced in Rawtherapee is almost mathematically (cognitively) perfect. It makes the xyY colors of the image coincide with known spectral data. However, on images where the temperature deviates a long way from D50, the colorimetry will not be correct because there will not be the necessary chromatic adaptation expected by our eyes and brain. Ciecam however, can take this into account.&lt;br /&gt;
&lt;br /&gt;
=== Importance of the Linear-RGB Model and Colorimetry ===&lt;br /&gt;
&lt;br /&gt;
The merits of the RGB model, and in particular, the linear RGB model are frequently cited. It is certainly the best way to carry out “upstream” processing (demosaicing, white balance, defringing, chromatic aberration correction, etc.) and anything that can be done in this mode should be.&lt;br /&gt;
&lt;br /&gt;
However, CIELAB and Ciecam02/16 still have their place despite their shortcomings. As we have seen above, they are both derived from the CIE XYZ tristimulus values with Ciecam being one of the only ways to achieve true colorimetric correction.&lt;br /&gt;
&lt;br /&gt;
So what about tone curves?&lt;br /&gt;
&lt;br /&gt;
* Not only are they non-linear but they only provide limited colorimetric compensation, if any (with the exception of the Perceptual mode, which uses Ciecam02). This is in contrast to the Tone Response Curves -TRC- used for output (monitor, TIF etc.).&lt;br /&gt;
* The Auto-Matched Tone Curve, which is a copy of the in-camera TRC, is applied mid-process and introduces non-linearities in the processing pipeline.&lt;br /&gt;
&lt;br /&gt;
What about saturation?&lt;br /&gt;
&lt;br /&gt;
* Maintaining RGB linearity when you change the saturation is not impossible but it is difficult and is not implemented in Rawtherapee. On the other hand, if you adjust the saturation using Ciecam, it will take into account variations in luminance (or brightness) and adapt the color accordingly.&lt;br /&gt;
&lt;br /&gt;
In conclusion, RGB, L *a *b *, and Ciecam all have their advantages and disadvantages. They simply need to be understood so that they can be used appropriately.&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10813</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10813"/>
		<updated>2024-08-22T06:54:17Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Les modules Tone-mapping description et utilité */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé, un choix est proposé pour rentrer dans le gamut.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans le gamut, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors du gamut, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Gamutmap - mis au point par Emil Martinec - permet de contrôler le gamut XYZ&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de rares processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab » ou autre système. Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)| Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
In english&lt;br /&gt;
[[Local_Adjustments#An_evaluation_of_the_dynamic-range_capabilities_of_tools_in_Selective_Editing | An evaluation of the dynamic-range capabilities of tools in Selective_Editing]]&lt;br /&gt;
&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10812</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10812"/>
		<updated>2024-08-22T06:50:50Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Les modules Tone-mapping description et utilité */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé, un choix est proposé pour rentrer dans le gamut.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans le gamut, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors du gamut, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Gamutmap - mis au point par Emil Martinec - permet de contrôler le gamut XYZ&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de rares processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab » ou autre système. Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)| Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10811</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10811"/>
		<updated>2024-08-22T06:41:19Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* L*a*b* */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé, un choix est proposé pour rentrer dans le gamut.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans le gamut, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors du gamut, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Gamutmap - mis au point par Emil Martinec - permet de contrôler le gamut XYZ&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de rares processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab » ou autre système. Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10810</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10810"/>
		<updated>2024-08-22T06:40:00Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Colorimétrie - Importance de Ciecam - Lab ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé, un choix est proposé pour rentrer dans le gamut.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans le gamut, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors du gamut, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Gamutmap - mis au point par Emil Martinec - permet de contrôler le gamut XYZ&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de nombreux processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab ». Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10809</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10809"/>
		<updated>2024-08-22T06:05:09Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Quels sont les principes acceptables pour traiter les images (SDR ou HDR)? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé et une intention de Colorimétrie Relative est appliquée.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans la gamme, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors de la gamme, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de nombreux processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab ». Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
[[Local_Adjustments#Using_the_Cam16_and_HDR_functions | Selective Editing - Cam16 and HDR functions]]&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10808</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10808"/>
		<updated>2024-08-22T06:01:29Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Ciecam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé et une intention de Colorimétrie Relative est appliquée.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans la gamme, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors de la gamme, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de nombreux processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab ». Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
&lt;br /&gt;
[[CIECAM02 | Ciecam - english]]&lt;br /&gt;
&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10807</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10807"/>
		<updated>2024-08-20T11:52:53Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Les modules Tone-mapping description et utilité */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé et une intention de Colorimétrie Relative est appliquée.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans la gamme, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors de la gamme, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de nombreux processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab ». Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%) Scene&amp;quot;. En effet pour les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper,&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based (mon préféré).&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile (sauf pour Sigmoid Q et Slope based Q qui sont incorporés au process Cam16).&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment:&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot;, et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part, entachée d’approximations et d’autre part, Ciecam prend en compte la luminance de l’arrière plan Yb%, et non la luminance de l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs: Black Ev, White Ev, Mean Luminance (Yb) Scene ?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que la fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables), les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey - ici Yb% Scene&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) Scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voire Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
	<entry>
		<id>http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10806</id>
		<title>Toolchain Pipeline/fr</title>
		<link rel="alternate" type="text/html" href="http://rawpedia.rawtherapee.com/index.php?title=Toolchain_Pipeline/fr&amp;diff=10806"/>
		<updated>2024-08-20T11:42:18Z</updated>

		<summary type="html">&lt;p&gt;Jdc: /* Quels sont les principes acceptables pour traiter les images (SDR ou HDR)? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;pagetitle&amp;quot;&amp;gt;Succession des outils dans le Pipeline - Colorimétrie générale&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Succession des outils dans le Pipeline==&lt;br /&gt;
===Ordre des traitements===&lt;br /&gt;
Tous les traitements apportés à une image, depuis le moment où vous ouvrez le fichier jusqu'au moment où il est affiché sur l'écran ou enregistré interviennent dans un ordre imposé. Les données migrent d'un module dans l'autre, c'est ce qu'on appelle la succession des outils dans le pipeline. RawTherapee contient 4 pipelines (un pour l'aperçu principal, un pour l'image enregistrée, un pour la vignette et un dernier qui m'échappe).&lt;br /&gt;
La liste suivante présente un ordre simplifié des opérations :&lt;br /&gt;
&lt;br /&gt;
# Prétraitement&lt;br /&gt;
## Trame Noire&lt;br /&gt;
## Champ Uniforme&lt;br /&gt;
## Mauvais pixels&lt;br /&gt;
## Pixels chauds&lt;br /&gt;
## Étalonnage des couleurs (interne, pas d'outil dans l'interface)&lt;br /&gt;
## Points Noir Raw&lt;br /&gt;
## Correction de distorsion d'objectif&lt;br /&gt;
## Équilibrage du vert&lt;br /&gt;
## Filtre du bruit de ligne&lt;br /&gt;
## Correction de l'aberration chromatique&lt;br /&gt;
## Points Blanc Raw&lt;br /&gt;
## Histogramme raw&lt;br /&gt;
## Préparation de l'exposition auto&lt;br /&gt;
# Dématriçage&lt;br /&gt;
# Retinex&lt;br /&gt;
# Reconstruction des hautes lumières&lt;br /&gt;
# Balance des blancs&lt;br /&gt;
# Suppression des spots&lt;br /&gt;
# Recadrage&lt;br /&gt;
# Conversion d'espace colorimétrique&lt;br /&gt;
# Noise reduction&lt;br /&gt;
# Elimination de la brume&lt;br /&gt;
# Compression de Plage Dynamique&lt;br /&gt;
# (branche local ajustements) évitement du décalage de couleurs, Log encoding, flou et bruit, réduction de bruit, netteté, dehaze et Retinex, cbdl, vibrance, lumière douce, contraste local, wavelet, exposition, couleur et lumière, Color apperance (Cam16 &amp;amp; Jzczhz), évitement du décalage de couleurs&lt;br /&gt;
# Courbe tonale auto-adaptée&lt;br /&gt;
# Courbe de réponse tonale&lt;br /&gt;
# Procédé RVB&lt;br /&gt;
## Mixage des canaux&lt;br /&gt;
## Courbe tonale&lt;br /&gt;
## Hautes lumières&lt;br /&gt;
## Ombres&lt;br /&gt;
## Courbes RVB&lt;br /&gt;
## Courbes TSV&lt;br /&gt;
## Virage partiel&lt;br /&gt;
## Simulation de film&lt;br /&gt;
## Noir-et-blanc&lt;br /&gt;
## Grille de correction de la couleur L*a*b* (Lab)&lt;br /&gt;
# Procédé Lab&lt;br /&gt;
## Ombres/hautes lumières (Lab)&lt;br /&gt;
## Contraste local (Lab)&lt;br /&gt;
## Ajustements Lab&lt;br /&gt;
## Vibrance&lt;br /&gt;
## Grille de correction couleur L*a*b* (Lab)&lt;br /&gt;
## Filtre vignettage&lt;br /&gt;
## Filtre dégradé&lt;br /&gt;
## Compression tonale&lt;br /&gt;
## Réduction du bruit d'impulsion&lt;br /&gt;
## Aberration chromatique&lt;br /&gt;
## Bordures&lt;br /&gt;
## Microcontraste&lt;br /&gt;
## Netteté&lt;br /&gt;
## Contraste par niveaux de détail&lt;br /&gt;
## Ondelettes&lt;br /&gt;
## Lumière douce&lt;br /&gt;
## Abstract Profile&lt;br /&gt;
## CIECAM02&lt;br /&gt;
## Redimensionnement&lt;br /&gt;
## Netteté après redimensionnement&lt;br /&gt;
# Conversion Lab -&amp;gt; RVB finale&lt;br /&gt;
&lt;br /&gt;
===Liste de tous les outils de RawTherapee===&lt;br /&gt;
* Générique/Aperçu principal&lt;br /&gt;
** Profil d'entrée&lt;br /&gt;
** Profil du moniteur couleur&lt;br /&gt;
** Profil de travail&lt;br /&gt;
** Profil de sortie&lt;br /&gt;
** Indications hors domaine&lt;br /&gt;
** Aperçus Rouge/Vert/Bleu/Luminosité/Masque du focus&lt;br /&gt;
** Intention colorimétrique &lt;br /&gt;
* Onglet Exposition&lt;br /&gt;
** Exposition&lt;br /&gt;
** Ombres/Hautes lumières&lt;br /&gt;
** Compression tonale&lt;br /&gt;
** Compression de Plage Dynamique&lt;br /&gt;
** Filtre Vignettage&lt;br /&gt;
** Filtre dégradé&lt;br /&gt;
** Ajustements Lab&lt;br /&gt;
* Onglet Détail&lt;br /&gt;
** Netteté&lt;br /&gt;
** Contraste local&lt;br /&gt;
** Bords&lt;br /&gt;
** Microcontraste&lt;br /&gt;
** Réduction du bruit d'implusion&lt;br /&gt;
** Réduction de bruit&lt;br /&gt;
** Aberration chromatique&lt;br /&gt;
** Contraste par niveaux de détail&lt;br /&gt;
** Elimination de la brume&lt;br /&gt;
* Onglet Couleur&lt;br /&gt;
** Balance des blancs&lt;br /&gt;
** Vibrance&lt;br /&gt;
** Mixage des canaux&lt;br /&gt;
** Noir-&amp;amp;-blanc&lt;br /&gt;
** Égaliseur TSV&lt;br /&gt;
** Simulation de film&lt;br /&gt;
** Lumière douce&lt;br /&gt;
** Courbes RGB&lt;br /&gt;
** Virage partiel&lt;br /&gt;
** Gestion de la couleur&lt;br /&gt;
* Onglet Avancé&lt;br /&gt;
** Retinex&lt;br /&gt;
** Apparance de la couleur (CIECAM02)&lt;br /&gt;
* Onglet Transformation&lt;br /&gt;
** Recadrage&lt;br /&gt;
** Redimensionnement&lt;br /&gt;
** Objectif/Géometrie&lt;br /&gt;
*** Rotation&lt;br /&gt;
*** Perspective&lt;br /&gt;
*** Profilcde correction d'objectif&lt;br /&gt;
*** Distortion &lt;br /&gt;
*** Aberration Chromatique&lt;br /&gt;
*** Correction vignettage&lt;br /&gt;
* Onglet Raw&lt;br /&gt;
** Capteur à matrice de Bayer&lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
*** Traitement pré-dématriçage&lt;br /&gt;
*** Aberration chromatique&lt;br /&gt;
** Capteur à matrice X-Trans &lt;br /&gt;
*** Dématriçage&lt;br /&gt;
*** Points noirs Raw&lt;br /&gt;
** Points blancs Raw&lt;br /&gt;
** Traitement pré-dématriçage&lt;br /&gt;
** Trame noire&lt;br /&gt;
** Champ uniforme&lt;br /&gt;
** Film Négatif&lt;br /&gt;
** Netteté de la capture&lt;br /&gt;
&lt;br /&gt;
==Colorimétrie générale==&lt;br /&gt;
===Colorimétrie - Importance de Ciecam - Lab ?===&lt;br /&gt;
De nombreux débats ont lieu à propos de la colorimétrie. Pour rappel ce n'est pas une science exacte...Il ne suffit pas de faire des équations (mêmes complexes..) pour que l’œil humain soit satisfait d'une image.&lt;br /&gt;
&lt;br /&gt;
Actuellement, RawTherapee utilise l'espace colorimétrique L*a*b* et CIECAM02/16 pour l'adaptation chromatique et des travaux ont commencé pour explorer d'autres espaces colorimétriques (Jzazbz) et modèles CAM, pour les applications HDR (ZCAM ne fonctionne pas).&lt;br /&gt;
&lt;br /&gt;
L'utilisation de l'espace couleur L*a*b* (ou CIELAB) a ses limites, mais nombre de ses défauts peuvent être atténués avec succès, du moins pour les applications SDR.&lt;br /&gt;
&lt;br /&gt;
Quelques exemples :&lt;br /&gt;
* On dit souvent que L*a*b* est non linéaire et qu'il « déforme » les couleurs notamment pour les bleus-violets et les rouges-oranges...si on agit par exemple sur une courbe ou un curseur chromaticité... C'est vrai ! Mais dans Rawtherapee, si vous cliquez sur « Avoid Color Shift », près de 200 LUT vont corriger cette dérive et rendre l'image parfaitement linéaire.&lt;br /&gt;
* On dit aussi que L*a*b* adresse des couleurs imaginaires...lorsque bien sûr le profil de travail le permet...C'est vrai. Mais dans Rawtherapee, si vous cliquez sur « Avoid Color shift » , le gamut du profil de travail est utilisé et une intention de Colorimétrie Relative est appliquée.&lt;br /&gt;
** Il analyse les données de l'image.&lt;br /&gt;
** Si elle est dans la gamme, aucune action n'est entreprise.&lt;br /&gt;
** Si elle est en dehors de la gamme, la chroma est réduite et si cela est insuffisant, ou si elle est proche de L=0 ou L=100, alors L est ajusté.&lt;br /&gt;
** Cependant, cela devrait rarement se produire si Prophoto est utilisé dans le profil de travail et n'est probablement pas important.&lt;br /&gt;
** Si la saturation a été ajustée (chroma, vibrance,...), une correction Munsell utilisant près de 200 LUTs est appliquée. Cela permet de corriger tout décalage de couleur avec un haut degré de précision, par exemple un rouge qui est devenu orange à cause de L*a*b*, redeviendra rouge. Il y aura encore quelques erreurs mais elles sont très faibles.&lt;br /&gt;
** Vous pouvez utiliser uniquement la correction Munsell en cochant &amp;quot;Correction Munsell uniquement&amp;quot;&lt;br /&gt;
=== L*a*b*===&lt;br /&gt;
* est une transformation réversible de XYZ (en simplifiant Y est transformé en L* par un gamma de 3.0 et une pente de 9.03), donc L*a*b* a sensiblement les mêmes caractéristiques en termes de limites - ce sont celles des primaires - que XYZ qui sert de référence au &amp;quot;Profil de travail&amp;quot; et fixe les bases du gamut. Donc 'sensiblement' les mêmes caractéristiques (latitude d'exposition, gamut, etc.). Un point toutefois, dans de nombreux processus les valeurs de L* peuvent être bornées (Clip), pour limiter des artefacts (contrastes élevés, les hautes lumières...). &lt;br /&gt;
* mais dans la plupart des cas, L* n’est pas limité. Si jamais un jour on arrive au traitement HDR, il faudra probablement passer au « HDR-Lab ». Les données ne sont pas perdues, même pour les images à plage dynamique élevée (&amp;gt; 14Ev), mais la progression des hautes lumières n'est pas assez progressive lorsqu'elle est utilisée avec des moniteurs capables d'afficher des valeurs de luminance dans la plage de 120 cd/m² et au-delà.&lt;br /&gt;
====L*a*b* ne pénalise pas le gamut et les images à haute dynamique -exemple image avec une Dynamic Range de 25Ev====&lt;br /&gt;
A noter que la majorité des appareils numériques en 2024, ont une Dynamique Range maximum de 15Ev. Cette image est donc exceptionnelle mais va montrer ici le comportement de L*a*b* pour les images à DR élévée.&lt;br /&gt;
&lt;br /&gt;
Fichier TIF  (Creative Common Attribution-share Alike 4.0): [https://drive.google.com/file/d/1vAzFY7Qh8MdJ882J_4JeO_cnpGELzD8D/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
=====Image d'origine - sans traitement=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres sont bouchées&lt;br /&gt;
* 40% environ de l'image est avec des blancs à 100%&lt;br /&gt;
* La DR originale est de 25Ev&lt;br /&gt;
* la DR restituée est de l'ordre de 12Ev&lt;br /&gt;
[[File:sweep-rgb-neutral.jpg|600px|thumb|center|Sans traitement]]&lt;br /&gt;
&lt;br /&gt;
=====Image avec Local Adjustments - Log encoding=====&lt;br /&gt;
Remarquez :&lt;br /&gt;
* les ombres et les lumières occupent toute la plage visible de L=1 à L=99.8 (échelle 0 - 100)&lt;br /&gt;
* les couleurs semblent uniformément réparties selon la luminance. L*a*b* ne pénalise pas la Dynamic Range (DR)&lt;br /&gt;
* la DR restituée est de 25Ev environ.&lt;br /&gt;
[[File:sweep-rgb-log.jpg|600px|thumb|center|Avec Log Encoding]]&lt;br /&gt;
&lt;br /&gt;
===Ciecam===&lt;br /&gt;
* On dit souvent que « Ciecam02 » n'est pas capable de traiter les images à hautes dynamique, c'est partiellement vrai. De nombreuses améliorations ont été apportées par l'équipe de développement  il y a quelques années pour réduire ce phénomène. Néanmoins il faut relativiser, une très forte proportion d'images utilisateur sont dans le gamut sRGB...et ne posent aucun problème. Cependant, en utilisant le Log Encoding en conjonction avec la Cam16, ou Color Appearance (Cam16 &amp;amp; JzCzHz), la grande majorité des problèmes peuvent être résolus. Bien sûr, certaines images présenteront encore des problèmes, en particulier avec la reconstruction des hautes lumières, mais ce n'est pas spécifique à Ciecam. L'ajout de Ciecam16 (Cam16) permet de résoudre certains de ces problèmes.&lt;br /&gt;
* Par contre Ciecam02/16  est une des seules manières de réaliser une véritable colorimétrie prenant en compte la perception de l'homme et de son environnement. Par exemple lors d'un souhait pour accroître la luminosité et/ou la saturation, Ciecam tiendra compte de l'image et de son environnement.&lt;br /&gt;
===Balance des blancs===&lt;br /&gt;
* La balance des blancs  est aussi sujet à débat...Le module « Itcwb » (Temperature correlation) récemment introduit dans Rawtherapee est du point de vue mathématique (cognitif) presque parfait. Il fait coïncider les couleurs xyY de l'image à des données spectrales connues ...Mais, sur les images où la température trouvée est loin de D50...la colorimétrie ne sera pas correcte...Il va manquer une adaptation chromatique, celle nécessaire à nos yeux, à notre cerveau. Ciecam va la réaliser. Je n’ai pas prévu une adaptation chromatique systématique. Vous pouvez la réaliser, par exemple, en mode symétrique avec Color Appearance &amp;amp; Lighting.&lt;br /&gt;
&lt;br /&gt;
===Importance du mode linéaire RGB et colorimétrie===&lt;br /&gt;
On vante souvent le modèle RGB, en particulier le modèle « linéaire ». Nous croyons que ce mode linéaire est la meilleure manière d'assurer les traitements « amont » (demosaicing, balance des blancs, defringe, aberration chromatique, etc.). tout ce qui peut être réalisé dans ce mode doit l'être. &lt;br /&gt;
&lt;br /&gt;
Par contre que penser – sauf pour des valeurs modérées – des « tone curves » :&lt;br /&gt;
* Qui non seulement rompent la linéarité, mais sont peu compensées en termes de colorimétrie (à l'exception du mode Perceptual qui fait appel à Ciecam02) – contrairement aux TRC utilisées dans les sorties (moniteur, TIF...).&lt;br /&gt;
* &amp;quot;Auto matched Tone Curve&amp;quot; - qui est en fait une copie de la TRC de l'APN est appliquée en milieu de processus, rompt la linéarité.. &lt;br /&gt;
&lt;br /&gt;
Comment rendre le mode RGB linéaire lorsqu'on change la saturation. Ce n'est probablement pas impossible, mais difficile, pas implanté dans Rawtherapee. En opposition à Ciecam « saturation »  qui tiendra compte des variations de luminance (ou de brillance)  pour adapter cette variation de couleur.&lt;br /&gt;
&lt;br /&gt;
Donc, en synthèse, il n'y a pas une bonne manière, et une mauvaise...Mais des méthodes RGB, L*a*b*, Ciecam qui ont leurs avantages et inconvénients...à utiliser à bon escient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Quels sont les principes acceptables pour traiter les images (SDR ou HDR)?===&lt;br /&gt;
L’argumentaire ci-dessous prend en partie ses fondements dans le fait que Rawtherapee dispose de deux modules Ciecam, l’un situé en fin du processus principal (Color Appearance &amp;amp; Lighting), l’autre dans Selective Editing, Color Appearance (Cam16) situé juste après la balance des blancs. Ces 2 modules sont des CAM (Color Appearance Model) et contiennent les méthodes et outils suffisants pour assurer une bonne colorimétrie. Néanmoins ces 2 modules ne sont pas toujours capables, seuls :&lt;br /&gt;
a) de traiter les images avec une trop forte dynamique, &lt;br /&gt;
b) ou les images avec des ombres très prononcées, &lt;br /&gt;
c) ou des images où les hautes lumières sont fortement présentes (à ne pas confondre avec la reconstruction des hautes lumières).&lt;br /&gt;
&lt;br /&gt;
La science de la colorimétrie est souvent inexacte et imprécise. Néanmoins comme vu précédemment, le traitement le plus linéaire possible semble recommandé si on peut le faire. Ceci semble toutefois impossible si les différences  liées à, a) b) c) ci-dessus sont importantes. &lt;br /&gt;
Dans ces cas je propose en première étape un principe proche de celui du rendu de la vision humaine : une partie linéaire (slope) pour &amp;quot;déboucher&amp;quot; les ombres et une partie parabolique (gamma) pour rendre la perception des moyennes et hautes  lumières assez semblable à celle de notre couple œil/cerveau. Ceci n’est pas une élucubration, on retrouve cette différenciation linéaire/parabolique dans de différents logiciels tels, la notion de &amp;quot;gamma sRGB&amp;quot; : slope=12.92 et gamma=2.4, ou de &amp;quot;BT709&amp;quot; : slope=4.5 gamma=2.22 ou de &amp;quot;Lab&amp;quot; : slope=9.03 gamma=3.0.&lt;br /&gt;
Les deux modules TRC &amp;quot;Tone Response Curve&amp;quot; présents soit dans &amp;quot;Abstract profile&amp;quot;, soit dans le module &amp;quot;Selective Editing, Source Data Adjustments&amp;quot; permettent d’apporter une réponse partielle au traitement des images au moins de type a) et b), en permettant l'ajustement avec  des valeurs plus élevées de slope et gamma.&lt;br /&gt;
&lt;br /&gt;
Reste ensuite à aborder le problème de l’atténuation des hautes lumières, l’amélioration du contraste global et l’utilisation d’un contraste local.&lt;br /&gt;
&lt;br /&gt;
N'oubliez pas que Cam16 est un module de traitement à part entière. Vous pouvez utiliser pour le traitement des images:&lt;br /&gt;
* Surround (Scene conditions) -  average, dim, dark, ... - qui permet de prendre en compte des fonds sombres ou très sombres. Cet algorithme peut à lui seul assurer dans certains images un traitement de relevage des ombres.&lt;br /&gt;
* Les divers réglages: Lightness, Brightness - et leurs contrastes associés, chroma, saturation, colorfullness, ...;&lt;br /&gt;
&lt;br /&gt;
Mais, l'essentiel est que le résultat vous convienne.&lt;br /&gt;
&lt;br /&gt;
===Utilité des profils d’entrée ICC et DCP ?===&lt;br /&gt;
Les fichiers Raw sont en général décodés en utilisant une matrice (origine Adobe) nommée &amp;quot;Color Matrix1&amp;quot; basée sur l’illuminant D65. Cette matrice est suffisante dans une très grande majorité de cas.&lt;br /&gt;
On peut y substituer soit un profil ICC, soit un profil DCP qui a été élaboré soit par soi-même par exemple à l’aide d’une Colorchecker24, soit fourni par Rawtherapee ou Adobe.&lt;br /&gt;
Les problèmes généraux de ces profils sont de 2 types :&lt;br /&gt;
* la Colorchecker24 se limite (à une exception près dans les bleus) au gamut sRGB. Que penser d’un profil qui sera utilisé par exemple sur des fleurs ou des minéraux où le gamut est nettement plus grand ?&lt;br /&gt;
* le profil n’a vraiment de pertinence que pour un illuminant donné. Que penser d’un profil élaboré en D50 (lumière du jour au soleil) et utilisé à l’ombre. Certes les profils DCP ont une table d’interpolation entre D65 et Tungstène 2850K, mais cela reste approximatif.&lt;br /&gt;
Mon propos n’est pas de s’opposer à l’utilisation de ces profils qui sont très utiles par exemple pour les reproductions (tableaux, monnaies,…) avec un éclairage maîtrisé, mais de montrer leurs limites.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir de &amp;quot;Auto-Matched Tone Curve&amp;quot;?===&lt;br /&gt;
La réponse est : peut-être ? &lt;br /&gt;
Cette courbe générée à partir du JPEG joint au Raw reproduit la colorimétrie du fabriquant de la caméra (Canon, Nikon,  Sony, etc.). C’est un critère de choix, mais qui présente quelques contraintes:&lt;br /&gt;
* la courbe générée peut amener un accroissement du contraste qui, selon les images, amènera un débordement de l’histogramme dans les basses et hautes lumières. Dans de nombreux cas, cet accroissement du contraste n’est pas souhaitable.&lt;br /&gt;
* le choix par défaut &amp;quot;Film-like&amp;quot; modifie la colorimétrie. Cette modification est en contradiction avec la philosophie de Ciecam. Il vaut mieux, si vous souhaitez conserver &amp;quot;Auto-Matched Tone Curve&amp;quot;, adopter le mode Standard.&lt;br /&gt;
&lt;br /&gt;
===Faut-il se servir du module &amp;quot;Exposure&amp;quot; et en particulier de &amp;quot;Exposure compensation&amp;quot;?===&lt;br /&gt;
La réponse est : avec réserves.&lt;br /&gt;
Dans le cas des images de type a), b) ou c) le slider &amp;quot;Exposure&amp;quot; va amener un changement de l’exposition de façon linéaire (en Ev), accroissant (ou réduisant) de la même manière les ombres et les lumières. Certes on peut agir sur &amp;quot;Highlight compression&amp;quot;, &amp;quot;black&amp;quot;, etc., mais cette modification n’est pas très intuitive et va à contresens de l’effet effectué par gamma/slope de la TRC (Tone Response Curve). Une alternative est d’utiliser &amp;quot;Tone Equalizer&amp;quot; (main ou Selective Editing) qui permet une différenciation progressive des ombres et lumières.&lt;br /&gt;
&lt;br /&gt;
===Les modules Tone-mapping description et utilité===&lt;br /&gt;
Je m’attarderais uniquement sur les modules se servant de &amp;quot;Black Ev&amp;quot;, &amp;quot;White Ev&amp;quot; et &amp;quot;Mean Luminance (Yb%)&amp;quot;. En effet les autres modules &amp;quot;Tone mapping&amp;quot; de Rawtherapee :&lt;br /&gt;
* &amp;quot;Tone mapping&amp;quot; est plus un module pour agir en profondeur sur le contraste local (texture) qu’un réel Tone-mapper&lt;br /&gt;
* &amp;quot;Dynamic Range Compression&amp;quot; utilise un Laplacien et une transformée de Fourier. Ses performances sont correctes, mais il est lent et consomme beaucoup de ressources.&lt;br /&gt;
* A noter que la majorité des images - y compris avec les camera modernes - sont limitées à 14 ou 15 Ev. Les logiciels HDR qui fabriquent une image DNG à partir de plusieurs images à partir de &amp;quot;bracketing&amp;quot; doivent pouvoir atteindre environ 20 Ev.&lt;br /&gt;
[[Local_Adjustments/fr#Évaluer_la_Dynamic_Range_des_outils_en_termes_de_Dynamic_Range_(DR)_-_branch_lacam16n | Évaluer la Dynamic Range des outils en termes de Dynamic Range]]&lt;br /&gt;
====Le principe de calcul de la Dynamique Range - DR====&lt;br /&gt;
Trois algorithmes utilisent les concepts liés à la Dynamique Range - Black Ev, White Ev, Mean Luminance (Yb) scene (concept proche de celui de &amp;quot;Middle grey&amp;quot;).&lt;br /&gt;
* Log encoding ;&lt;br /&gt;
* Sigmoid;&lt;br /&gt;
* Gamma based et Slope based.&lt;br /&gt;
&lt;br /&gt;
Comment sont évaluées ces valeurs ? L’exercice est difficile, car il consiste à trouver sur une image non traitée, le point le plus noir (Black point), le point le plus blanc (White point) et la valeur du gris moyen (Yb%). Une formule assez empirique et approximative évalue ces 3 données qui seront ensuite utilisées par les 3 algorithmes cités.&lt;br /&gt;
* la première question est : &amp;quot;De quelles données se sert-on, et à quel niveau du processus ?&amp;quot;. Rawtherapee se sert des données juste après la balance des blancs et après conversion vers le Working profile.&lt;br /&gt;
* la seconde question est : &amp;quot;Est-ce que ces valeurs sont représentatives de la réalité ?&amp;quot;. Pas sûr… Notamment :&lt;br /&gt;
** on ne connaît pas la cartographie des noirs près du &amp;quot;Black point&amp;quot; et des blancs près du &amp;quot;White point&amp;quot;,&lt;br /&gt;
** la valeur du &amp;quot;Middle grey&amp;quot; est d’une part entachée d’approximations et d’autre part Ciecam prend en compte la luminance de l’arrière plan Yb%, et non l’image entière.&lt;br /&gt;
** ceci m’a amené – plutôt que de jouer empiriquement sur les 3 paramètres Black Ev, White Ev, Mean luminance (Yb%) Scene - de prévoir l’action sur la distribution des noirs et des blancs, cette action ayant une incidence sur la valeur de Mean Luminance (Yb%) Scene. Par défaut &amp;quot;White distribution&amp;quot; est à 20 pour tenir compte de Ciecam (Yb%).&lt;br /&gt;
&lt;br /&gt;
====Comment sont utilisées ces 3 valeurs Black Ev, White Ev, Mean Luminance (Yb)?====&lt;br /&gt;
* Log encoding, calcule une base logarithmique à partir des valeurs de Black Ev Scene, Dynamic Range et de Mean Luminance (Yb%) Viewing. Cette conversion logarithmique est appliquée à l’ensemble des données à traiter. Il semble évident que ici le traitement est &amp;quot;tout sauf linéaire&amp;quot;. Selon les images on aboutira quelquefois à un excès de relevage des ombres et d’atténuation des lumières, par rapport aux lumières moyennes. De plus cette conversion peut modifier la colorimétrie en profondeur. Pour Log encoding,  l’algorithme présent dans Rawtherapee ne prévoit que de simples corrections de colorimétrie (saturation, brightness compression). L’avantage de cet algorithme est qu’il peut traiter de très fortes dynamiques.&lt;br /&gt;
* Sigmoid, comme son nom l’indique se sert d’une sigmoid mathématique basée sur 3 concepts principaux : a) une atténuation asymptotique (surtout des blancs) rendant aux hautes lumières un aspect plus naturel ; b) une pente variable de la sigmoid agissant sur le contraste global ; c) un déplacement (skew) de la sigmoid pour que l’action soit prioritairement sur les lumières ou les ombres (on ne peut avoir les deux). L’avantage de cet algorithme c’est sa simplicité apparente, il fonctionner très bien sur des images pas trop difficiles. &lt;br /&gt;
** Simulation : je joins une démonstration d'une Sigmoid avec 2 paramètres où &amp;quot;L&amp;quot; correspond au &amp;quot;contraste&amp;quot; et &amp;quot;t&amp;quot; correspond à &amp;quot;Skew&amp;quot;. A noter que le calcul réalisé dans le code est un peu différent. Cette simulation est uniquement à caractère pédagogique.&lt;br /&gt;
** https://www.desmos.com/calculator/g382ci99gu?lang=fr&lt;br /&gt;
* Gamma based et Slope based, utilisent tous les deux l’algorithme Tone-mapping de Freeman. Gamma based n’utilise que fonction asymptotique pour rendre aux hautes lumières un aspect plus naturel. Slope based y ajoute la partie des basses lumières et tons moyens. Son principe est quelque peu différent de celui de Sigmoid, assez proche de celui d’une TRC (le traitement des basses lumières n’étant pas strictement linéaire). L’avantage de cet algorithme est sa simplicité, il permet un traitement performant de l'atténuation des hautes lumières et permet aussi d’agir sur le contraste global.&lt;br /&gt;
** Vous disposez également du choix &amp;quot;RGB channel Slope&amp;quot; qui s'apparente en partie à &amp;quot;RGB curves&amp;quot; permettant une action différenciée sur les 3 canaux R, G et B. Par rapport à Slope based, des réglages ont été ajoutés pour exploiter pleinement l'algorithme de Freeman : &lt;br /&gt;
*** Prise en compte de la DR (dynamic range) pour Yb Viewing, en plus de Yb Scene,&lt;br /&gt;
*** Lumosity mode pour essayer de préserver la luminance (similaire à RGB curves) - ce mode peut amener de forts artefacts,&lt;br /&gt;
*** Prise en compte d'un seuil (Attenuation threshold) associé au choix &amp;quot;Highlight attenuation only&amp;quot; pour moduler le début de l'action sur les highlights (normalement à partir de Yb scene).    &lt;br /&gt;
&lt;br /&gt;
Dans les 3 cas (Log encoding, Sigmoid, algorithme de Freeman) on utilise les données de &amp;quot;Scene&amp;quot; (Source) pour les faire rentrer dans une plage utile pour notre vue ou nos périphériques (écrans,…).&lt;br /&gt;
Cette plage utile est elle aussi source de débats : a) doit-on se servir de luminance relative pour les périphériques de sortie ou de la luminance absolue avec les notions pour la luminance de &amp;quot;Peak&amp;quot; et de &amp;quot;Diffuse white&amp;quot; ; b) notre couple œil cerveau dispose de performances nettement supérieures à tous les systèmes et prend en compte d’autres paramètres physiologiques (Ciecam).&lt;br /&gt;
Le module Cam16 (Selective Editing) essaye de prendre en compte (au mieux) l’ensemble de ces paramètres.&lt;br /&gt;
&lt;br /&gt;
* Le cas de Sigmoid Q et Slope based Q : j’ai tenu à intégrer dans la boucle Q (Absolute luminance) de Cam16 (qui dispose de 6 variables, les 2 algorithmes Sigmoid et Slope based. Il est évident que nous ne sommes plus en amont du processus, mais dans le processus. En particulier la valeur de &amp;quot;Middle grey&amp;quot; est profondément modifiée par Ciecam. J’ai appliqué un coefficient correctif empirique moyen. Ces 2 algorithmes doivent plus être vus comme des défis personnels, que comme de réelles alternatives.&lt;br /&gt;
&lt;br /&gt;
====Comment utiliser ces algorithmes Tone-mapping ? ====&lt;br /&gt;
* Ces algorithmes Tone-mapping peuvent être qualifiés de semi-automatiques, car les paramètres utilisés Black-point, White-point, Mean Luminance (Yb%) scene, sont pré-calculés automatiquement. Les valeurs à ajuster de Sigmoid ou Slope based sont proches des valeurs par défaut.&lt;br /&gt;
* Log encoding, peut être utilisé en première étape, et en complément on peut utiliser la TRC (gamma, slope, midtones), voir Sigmoid.&lt;br /&gt;
* Pour les autres cas (majoritaires), je recommande de commencer le processus par la TRC  (gamma, slope, midtones) et d’atténuer les hautes lumières soit par &amp;quot;Ev based&amp;quot;, &amp;quot;Gamma based&amp;quot;. Si un accroissement du contraste global est souhaité vous pouvez activer &amp;quot;Slope based&amp;quot; ou &amp;quot;Sigmoid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Rawtherapee_Processing_Challenge_feedback | Rawtherapee Processing Challenge April 2024]]&lt;br /&gt;
&lt;br /&gt;
===Le contraste local===&lt;br /&gt;
Comme je l’ai évoqué précédemment, je pense qu’il vaut mieux pour mettre en valeur le sujet principal (fleur, immeuble, animal…) agir modérément sur le contraste global et compléter par un contraste local.  Celui-ci se présente sous 2 formes :&lt;br /&gt;
* soit par un algorithme de type Guided-filter (incorporé à  Cam16), pour de petits ajustements,&lt;br /&gt;
* soit en utilisant le contraste local (variable) utilisant les wavelets. &lt;br /&gt;
** Dans &amp;quot;Abstract profile&amp;quot; vous disposez de &amp;quot;Contrast enhancement&amp;quot; s’appuyant sur la notion de &amp;quot;Contrast profiles&amp;quot;.&lt;br /&gt;
 [[File:APwav.jpg|600px|thumb|center|Abstract Profile &amp;amp; Contrast Enhancement]]&lt;br /&gt;
* Dans Selective Editing, vous avez en mode Basic &amp;quot;Local contrast &amp;amp; Wavelets&amp;quot; qui vous permet, en choisissant l’étendue des niveaux de décomposition concernés, d’agir sur le &amp;quot;Local contrast&amp;quot;, mais aussi sur la &amp;quot;Clarity&amp;quot;.&lt;br /&gt;
[[File:locwav.jpg|600px|thumb|center|Local Contrast &amp;amp; Wavelets]]&lt;/div&gt;</summary>
		<author><name>Jdc</name></author>
	</entry>
</feed>